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 are the three parts of a simple empty class?

0 Answers  


i hav very low percentage in 12th n BSCwhich is around 50.......coz it was just imposed on me 2 b a science graduate,nw m doin MCA n hav aggregate 74% ....what shud i answer if company's HR ask me about dis much low previous percentage??????

3 Answers   Infosys,


143.what is oops principles?

10 Answers  


Which language is pure oop?

0 Answers  


What is the point of polymorphism?

0 Answers  


What is a mixin class?

4 Answers  


When you define a integer it gets stored in which data structure?(Stack or a heap)

2 Answers   emc2,


What is a macro? And how is a macro same as a template?

4 Answers  


How to calculate the age from the date of birth by using the program?

2 Answers   Accenture,


What is abstract class in oops?

0 Answers  


what is an qt4 interface?

1 Answers   IBM,


Example for 4 pillar of oops like, Inheritance,Poly,Abstraction,Encabsulation ?

3 Answers  


Categories