What happens when you assigned a 'double' value to
a 'String'?
Answer Posted / cleon
@Pankaj:
What are you trying to do?, trying to call a function from
primitive type/reference, that that will never work. You can
call function on Object types.
Double d = 5.5D; //D is optional as by default it is treated
to be double value
String s = d.toString();
If one tries to do something like
String s = 5.5;
A type mismatch errors will be shown during compilation itself!!
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
How do you start a thread?
What is literal example?
What is sortedmap interface?
What is the difference between Java Program Constructor and Java Program Method, What is the purpose of Java Program constructor Please Explain it Breafily?
What is difference between variable declaration and definition?
Which category the java thread do fall in?
Name component subclasses that support painting in java programming?
What string is utf8?
What are extraneous variables examples?
how to deploy tomcatserver to weblogic server? write d following steps?
what is the significance of listiterator in java?
Can we overload final method in java?
What are JVM.JRE, J2EE, JNI?
Is java based on c?
What is difference between synchronize and concurrent collection in java?