CodeKru
Menu

Tutorial archive

Category: <span>Java conversions</span>

Browse individual tutorials and references.

9 published articles

Java

How to convert String to double in Java?

In this post, we will be looking at different ways of converting a string object into a double value. In some of the methods listed below, we will be converting the string object into the Double

Java

How to convert double to String in Java

There are many ways to convert a double value into a string in Java. Double.toString() methodString.valueOf() methodUsing + operatorUsing StringBuilder or StringBuffer append() functionUsing DecimalFormat Let's look at…

Java

How to convert a double to an int in Java?

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 ).Second, whether we want to convert our

Java

How to convert long to int in Java?

There are different ways of converting a long to an int in Java. Math.toIntExact() methodintValue() methodUsing Strings There is a reason that our list does not contain direct typecasting of long into an int because it

Java

How to convert String to long in Java

In this post, we will be looking at different ways of converting String to long in Java. We will first convert the String object into the Long wrapper class object in Java and but because of

Java

How to convert String to int in Java?

In this post, we will be looking at different ways of converting String to int in Java. In most of the cases, we will convert the string Object into the Integer wrapper class object but because

Java

How to convert long to String 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. Long.toString() methodString.valueOf() methodUsing

Java

How to convert an int to a string 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() methodString.ValueOf() methodUsing + operatorUsing

Java

Convert list to map in java

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. To understand this, we will