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 have more than one package statement in source file ?
What is functional interface in java?
Difference between notify() method and notifyall() method in java?
Can we restart a thread already started in java?
What are runtime exceptions?
What is integers and example?
Is it possible for a yielded thread to get chance for its execution again?
Why static functions are used?
Difference between object instantiation and construction ?
How to sort elements in a parallel array in java?
Does sprintf allocate memory?
What is numeric data type?
Can an interface have a class?
Is java util list serializable?
Give some features of interface?