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.
Code Description:
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:
import java.io.*;
|
Output of this program given below.
| C:\corejava>java IntegerToDouble Enter the integer value: 24 Double:=24.0 C:\corejava> |
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.
Ask Questions? Discuss: Convert Integer to Double View All Comments
Post your Comment