1).what is the difference between below examples

String s="vijay";

String s=new String("vijay");

Answer Posted / uday

Hi All,
Here one object is stored in the heap and you said that
you can change that, but bydefault String objects are
immutable(ReadOnly), how can u change it?

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Tell us something about an iterator.

550


What is the driver class?

569


What is the meaning of I ++ in java?

610


What are the difference between composition and inheritance in java?

518


What is internal variable?

542






What does super keyword do?

562


What is anagram word?

525


What is a parameter in a function?

530


Explain about complier design(phases)

632


How we can run a jar file through command prompt in java?

526


What technique can be employed to compare two strings?

578


What are thread safe functions?

517


What is a java applet? What is an interface?

635


How do you avoid global variables?

545


What are autoboxing and unboxing? When does it occur?

536