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


what is difference between
String s=new String("vali");
String s="vali"



what is difference between String s=new String("vali"); String s="vali"..

Answer / kartik sharma

In case of String s=new String("vali"); , a memory in the heap is allocated to the variable of the class String, and then the value is given to the variable s="vali". Using new operator , we can allocate the memory to the instance of the class.


But in String s="vali" , only the variable s is given the value as vali but there is no permanent memory given to the variable in heap.

Is This Answer Correct ?    6 Yes 2 No

Post New Answer

More OOPS Interview Questions

What is an example of genetic polymorphism?

0 Answers  


i ahve v low % in 12th n BSC which is aroun 50 coz science was imposed on me......nw m doin MCA n my aggregate in above 74%,what shud i say if asked about low previous percentage??????

4 Answers  


how do you handle yourself when you feel the wald is aganist you

2 Answers  


how to write a java program for an output ****0 ***01 **012 *0123 01234

1 Answers  


why function overloading is not called as pure polymorphism?

2 Answers  


what are the realtime excercises in C++?

0 Answers   IBM, Wipro,


Is oop better than procedural?

0 Answers  


write a c++ program to find maximum of two numbers using inline functions.

3 Answers   IBM,


What is coupling in oops?

0 Answers  


Why a "operator=(...)" when there is a copy ctor?

2 Answers  


what are the characteristics of oops?

7 Answers   NIIT,


What is abstraction oop?

0 Answers  


Categories