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

How do you convert an int to a double in java?

1112


What does  mean in regex?

1108


What is the use of protected in java?

1068


How will you reverse a singly-link list?

1051


Are generics important java?

1037


What’s the difference between unit, integration and functional testing?

1164


What is sizeof in java?

1170


What is java util function?

1168


What is the difference between preemptive scheduling and time slicing?

1109


How hashset works internally in java?

1140


What is volatile data type?

1068


Can we nested try statements in java?

1147


What does serializing data mean?

1003


Can we override a variable in java?

1067


What are instance variables?

1126