give an example of converting a double data type to string data type
Answers
Answered by
0
There are three ways to convert double to String.
Double.toString(d)
String.valueOf(d)
""+d. public class DoubleToString { public static void main(String[] args) { double d = 122; System.out.println(Double.toString(d)); System.out.println(String.valueOf(d)); System.out.println(""+d); } }
Answered by
0
Answer:
public class DoubleToStringExample1{
public static void main(String args[]){
double d=12.3;
String s=String.valueOf(d);
System.out.println(s);
}}
Explanation:
Similar questions
Physics,
2 days ago
Math,
2 days ago
English,
5 days ago
Computer Science,
8 months ago
English,
8 months ago