Tutorial archive
Browse individual tutorials and references.
9 published articles
In this post, we will be looking at different ways of converting a string object into a double value.
There are many ways to convert a double value into a string in Java. Double.toString() method String.valueOf() method Using + operator Using StringBuilder or StringBuffer append() function Using DecimalFormat Let's look…
Before proceeding, there are few points that we should know about While converting double to an int, the decimal values will be lost ( 3.14 would be converted 3 ).
There are different ways of converting a long to an int in Java. Math.toIntExact() method intValue() method Using Strings There is a reason that our list does not contain direct typecasting of long into an int because…
In this post, we will be looking at different ways of converting String to long in Java.
In this post, we will be looking at different ways of converting String to int in Java.
There are many scenarios where we may be required to convert a long to a String. This post will discuss how we can convert a long integer to a string type in Java.
This post will look at various ways of converting an int to a String in Java. Below are some of the many ways of converting an int to a String - Integer.toString() method String.ValueOf() method Using + operator Using…
We often come up with requirements where we need to convert the list into a map. In this article, we will learn how to do it before and after Java 8.