Computer Science, asked by sharmisthabanik370, 5 days ago

give an example of converting a double data type to string data type​

Answers

Answered by dollctonger2009
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 samarthkrv
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