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 indexof?

913


What is super?

1047


What is an object in java and how is it created?

1003


Can we return null in java?

1064


How do you clear a method in java?

953


What do you mean by scope of variable?

827


What is an infinite loop? How infinite loop is declared?

1014


Can we create more than one object singleton class?

986


What is the use of conditional statement?

931


What are Normalization Rules? Define Normalization?

978


Explain about the interpreter in java?

990


Can we use string in the switch case?

983


What is bufferedreader in java?

996


Can I use % with real numbers?

961


How java uses the string and stringbuffer classes?

998