Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

suppose string s1="rajnish";
string s2="bhaskar";
then what will be happend ?

Answer Posted / venkat

FIRST OF ALL THE JVM CREATED THE OBJECTS FOR STRING
CLASSESS IN TWO WAYS
1)STRING S1=NEW STRING("VENKI");
2)STRING S2="VENKI"
IN SECOND APPROACH WHEN THE JVM IS EN COUNTED THE ""
(DOUBLE QUOTATIONS) THEN IT UNDERSTOOD ,AND CREATED THE
OBJECT FOR THE S2 , AND THIS OBJECT IS PLACED IN THE STRING
POOL (SEPERATE MEMORY LOCATION IS MAINTAINED) . i.e in this
position we are not creating the object for the string class
explicitly ,the jvm internally created this object

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between the paint() and repaint() methods in java programming?

1241


What are the differences between this and super keyword?

986


How do you do descending order in java?

1013


What is boolean flag in java?

1155


What are the main uses of the super keyword?

1021


How do you add an element to an arraylist in java?

998


What does indexof mean?

1106


What is the purpose of return statement?

1124


Why stringbuffer is faster than string?

1094


Which collection does not allow duplicates in java?

1033


Can we access instance variables within static methods ?

1156


What is array length in java?

1016


Implement two stacks using a single array.

1109


What is java regex?

1061


What is meant by design patterns?

1094