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
Can we overload run() method in java?
Is it safe to install java on my computer?
What is difference between iterator and enumeration in java?
Explain the difference between static and dynamic binding in java?
Can you extend singleton class?
What is api data?
What is console based application in java?
What is the use of pattern in java?
What is linkedlist in java?
What are the 3 types of control structures?
What are synchronized methods ?
Is main a function?
What is boolean in java?
What is a parameter in simple terms?
Does substring create a new object?