• 10 November

    Java List to String

    In this post, we will see how to convert List to String in java. Following are the ways to convert list into String: Using StringBuilder We can use StringBuilder class to convert List to String. StringBuilder is the best approach if you have other than String Array, List.We can add elements in the object of […]

  • 10 November

    Java Convert Array to List

    In this post, we will see how to convert array to list in java. There are may ways to convert array to list: By using Arrays.asList(): This is an easy method to convert Array into list.We just need to pass array as parameter to asList() method.It is a Static method available in Arrays class so, […]

  • 10 November

    Java convert List to Array

    In this post, we will see how to convert List to Array in java. There are many ways to convert List to Array in java Using toArray() method We can use toArray() method to convert List to String. We can either pass a array of size as List’s length or we can pass empty array. […]

  • 04 November

    How to convert String to int in Java

    In this article, we are going to see how we can convert from a String data type into integer data type in Java. Conversion Modes There are two ways in which String data can be converted into integer. They are: Using the static method parseInt(String) of the java.lang.Integer wrapper class Using the static method valueOf(String) […]

  • 04 November

    How to convert String to Double in Java

    With the introduction of different data types, the need for conversion of one data type to another has come into being. In this article, we are going to see how we can convert from a String data type into Double data type. Conversion Modes There are two ways in which String data can be converted […]

  • 05 October

    Java String to BigDecimal

    In this post, we will see how to convert String to BigDecimal in java. It is very simple to convert String to BigDecimal in java. You can simply use BigDecimal ‘s String based constructor to do it. [crayon-600824de79e43849293205/] Above constructor convert String representation of BigDecimal to BigDecimal Let’s see this with the help of example: [crayon-600824de79e48088586310/] […]

  • 05 October

    Java BigDecimal to String

    In this post, we will see how to convert BigDecimal to String in java. There are many ways to convert BigDecimal to String in java. Some of them are: Using toString() Using String.valueOf() toString method You can simply use BigDecimal’s toString method to convert BigDecimal to String. [crayon-600824de7a143288042623/] When you run above program, you will […]

  • 24 September

    How to convert List to Set in java

    In this post, we will see how to convert List to Set in java.We will convert ArrayList to HashSet. As HashSet does not allow duplicates, when you convert ArrayList to HashSet, all the duplicates will be discarded. You can simply use the constructor of HashSet to convert ArrayList to HashSet. [crayon-600824de7a3e3615053271/] Here is simple example: […]

  • 21 October

    How to convert Byte Array to String in java

    Sometimes, we may need to convert String to bytes Array but how to convert bytes array to String back. toString method does not work correctly here as it just print bytes in String format. You can use String’s constructor to get String back. Example: [crayon-600824de7a9c8945449434/] When you run above program, you will get below output: […]