In this section, you will learn to convert an integer into a double. The the java.lang package provides the functionality for converting an integer type data into a double.
This program helps you in converting an integer type data into a double. Define a class named "IntegerToDouble" for java component. Program takes an integer value at the console and it converts an integer type data into a double using the toString() method. This method returns a string representation of a double object. It converts a double into a string and also vice-versa.
Here is the code of this program:
Output of this program given below.
Enter the integer value:
If you enjoyed this post then why not add us on Google+? Add us to your Circles
Liked it! Share this Tutorial