Skip to content
sneppets

sneppets

  • Privacy
sneppets-java8

Java Round up a Float value to an Int value

February 11, 2020February 12, 2020 Editorial StaffLeave a Comment on Java Round up a Float value to an Int value

This tutorial shows you how to round up a float value to an int value using ceil() and floor() methods.

Java int, java, math, roundup
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

Posts navigation

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