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

What is the difference between an if statement and a switch statement?

1158


What is native method in java?

1053


Is java good for beginners?

1008


Why parameters should be passed by reference?

960


What is constructor chaining and how is it achieved in java?

1138


What is a package in java? List down various advantages of packages.

1272


What are the basic control structures?

975


Difference between Preemptive scheduling vs. Time slicing?

1011


What is finally and finalize in java?

1085


What is math in java?

1056


What is nested loop? What is dangling else condition in it?

1069


How to store image in arraylist in java?

967


What is the ==?

878


What is a class variable?

1032


What is tree in java?

911