Skip to content
sneppets

sneppets

  • Privacy
sneppets-java8

Java : Convert comma separated String to List

February 11, 2020February 12, 2020 Editorial StaffLeave a Comment on Java : Convert comma separated String to List

This tutorial shows you how to convert comma separated String to List and vice versa.

Java arrays, collections, java, String
sneppets-java8

Java : How to find intersection of two Sets

February 11, 2020February 12, 2020 Editorial StaffLeave a Comment on Java : How to find intersection of two Sets

This tutorial explains you two ways to find intersection of  two Sets, i.e., using Java 8 Stream feature and Set’s retainAll() method.

Java HashSet, Intersection, java, Set
sneppets-java8

Get time units hours and minutes from Date in String format

February 10, 2020February 12, 2020 Editorial StaffLeave a Comment on Get time units hours and minutes from Date in String format

This tutorial shows how to get time units hours and minutes from Date in String format using java.text.SimpleDateFormat class. SimpleDateFormat class allows us to format date to text and to parse text to date.

Java Date, hours, java, simpledateformat
calculate leap year

Java : Calculate Leap Year and Number of days in a Year

February 9, 2020February 12, 2020 Editorial StaffLeave a Comment on Java : Calculate Leap Year and Number of days in a Year

Below program shows you how to calculate or check if a year is leap year or not and how to check number of days in a year.

Java Calendar, java, leap year
sneppets-java8

Java : How to Compare two Sets and check its Equality efficiently

February 6, 2020February 12, 2020 Editorial StaffLeave a Comment on Java : How to Compare two Sets and check its Equality efficiently

This tutorial explains the best and efficient way to compare two sets and equality using containsAll() and equals() method of Set interface. let’s look at the example below.

Java java, performance, Set

Posts navigation

Older posts
Newer posts
Copyright © 2018 Sneppets. All Rights Reserved