1).what is the difference between below examples

String s="vijay";

String s=new String("vijay");

Answer Posted / p.sreekiran

in first string class it create in heep memory and second
is created object in constant memeory we cannot change the
second one

Is This Answer Correct ?    2 Yes 13 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is private static in java?

785


In java, how we can disallow serialization of variables?

731


What is difference between static class and singleton pattern?

673


What is the difference between Array and Hash Table?

777


How do you do a line break in java?

672


How can we make sure main() is the last thread to finish in java program?

927


How do you write methodology?

732


Is double bigger than float?

740


What does int argc char * argv [] mean?

715


How is hashset defined in java?

723


1.IN CASE OF DYNAMIC METHOD DISPATCH WHY WE USE REFERENCE VARIABLE,WE CAN USE THE DIFFERENT DEFINED OBJECT DIRECTLY TO ACCESS THE DATA MEMBER AND MEMBER FUNCTION OF THAT RESPECTIVE CLASS?WHAT IS THE MAIN FUNCTION OF "REFERENCE VARIABLE" HERE?

4367


What are the main uses of this keyword?

804


What technique is carried out to find out if a particular string is empty?

775


What are the advantages of encapsulation in java?

740


How do you achieve polymorphism in java?

712