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

hi, this is raju,iam studying b.tech 2nd year,iam want know about group1 and group2 details, and we can studying without going to any instutions? please help me.

0 Answers  


What are the three parts of a simple empty class?

0 Answers  


What is the difference between procedural programming and oops?

0 Answers  


Why multiple inheritance is not allowed?

0 Answers  


What does sksksk mean in text slang?

0 Answers  


Write a program to implement OOPS concepts such as inheritance, polymorphism, friend function, operator overloading?

0 Answers   TCS,


How compiler selects(internally) required overridden function in inheritance?

2 Answers   CSC, Infinite Computer Solutions,


Will I be able to get a picture in D drive to the c++ program? If so, help me out?

0 Answers  


What is the oops and benefits of oops programming?

0 Answers  


features of OOPS

22 Answers   Ness Technologies, Satyam,


What are the components of marker interface?

0 Answers  


What do you mean by binding of data and functions?

3 Answers  


Categories