What happens when you assigned a 'double' value to
a 'String'?

Answer Posted / ravikiran(aptech mumbai)

compilation fails

double d=10.5;
String f=(String)(10.5);

will work

Is This Answer Correct ?    1 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between && and & in java?

559


What is the use of math abs in java?

539


Difference between java and javascript

576


Can a class be private or protected in java?

541


Does variable declaration allocate memory?

575






Does sprintf allocate memory?

582


What is the difference between the ">>" and " >>>" operators in java?

499


Is array passed by reference in java?

568


What do you mean by chromounits in java8?

520


What is variable and example?

509


What is parsing and its types?

575


how to split string in java?

643


What are the different access modifiers available in java?

555


What is the difference between a local variable and an instance variable?

540


What is a nested list?

509