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...

difference between String a; and String a=new String();?
y do v need to assign memory to the variable?

Answer Posted / janardhan

String a; :---

JVM will create String object in SCPM(String constant pool
memory)only.

String a=new String();:---

JVM will create String object in two memories
1. Heap memory
2. String constant pool memory.

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we convert stringbuilder to string in java?

993


What is the effect of keeping a constructor private?

951


What's the difference between comparison done by equals method and == operator?

974


What does snprintf return?

1007


What methodology can be utilized to link to a database?

969


What is the largest data type in java?

979


What is unmodifiable collection in java?

926


what are the high-level thread states? : Java thread

1024


What is the maximum size of a string in java?

1104


Write a code to create a trigger to call a stored procedure

981


What is a local class in java?

1047


What is a java lambda expression?

1052


Can we initialize the final blank variable?

1093


What is the difference between numeric and integer?

1011


Is java a security risk?

1048