Question #7110

How do I convert a stringbuffer into a double in Java?

Expert's answer

StringBuffer buffer = new StringBuffer();// StringBuffer object
buffer.append
("11");//add 11 to StringBuffer
String s = buffer.toString();// convert
StringBuffer to string
double num=Double.parseDouble(s);//convert string to
double
System.out.println(num);

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS