java

java

Java program to convert a string to ArrayList

Java program to convert a string to arraylist. This post will show different ways to convert a string to arraylist in java

Read
java

Java program to convert byte to string

Java program to convert a byte value to string. In this post, we will learn two different ways to do the convertion.

Read
java

Java program to convert a character to string

Java program to convert a character to string in different ways. We will learn two different ways to convert a character to a string in Java.

Read
java

3 different ways in Java to convert comma-separated strings to an ArrayList

Java program to convert comma separated strings to an ArrayList. This post will show you three different methods to convert comma separated strings to an ArrayList in Java.

Read
java

3 different ways to iterate over a HashSet in Java

Java program to iterate over the hashset items in three different ways. We will use an iterator, for loop and forEach to do that.

Read
java

How to remove specific items or remove all items from a HashSet

Java program to remove specific items or all items from a HashSet. Learn it with different examples.

Read
java

How to add items to a HashSet in Java

Java program to add items to a HashSet. We will use the add method of HashSet to add new items to a HashSet.

Read
java

Java program to find the maximum element in a HashSet

Java program to find the maximum element in a HashSet. we can either run a loop and find out the maximum or we can use the predefined method max defined in Collections.

Read
java

How to convert a negative number to positive in Java

Learn how to convert a negative number to positive in Java. We will learn two different ways to do the conversion in Java. We can multiply the number by -1 or we can use the Math.abs() method.

Read
java

Java program to get the epoch timestamp

How to get the epoch timestamp in Java. This post will show you number of milliseconds and seconds passed since epoch.

Read