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

1).what is the difference between below examples

String s="vijay";

String s=new String("vijay");

Answer Posted / navneet raushan

the first case does: if u write first case , one object and
one refernce will be created. object will be created in
string pool.
But when u write 2nd case , two object and one refernce
will be created , one in string pool and one in heap.

Is This Answer Correct ?    1 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you convert int to char in java?

1120


List out benefits of object oriented programming language?

941


Explain about main() method in java ?

1113


Can we rethrow the same exception from catch handler?

1172


What is use of inner class in java?

1236


What’s the difference between the methods sleep() and wait()?

1064


Why Java is not pure Object Oriented language?

1157


What is a singleton in genetics?

1128


Is alive and join method in java?

1258


What is the final blank variable?

1181


What do you mean by append?

1134


What is an array in java?

1281


Why is method overloading not possible by changing the return type in java?

1052


Is string thread safe in java?

1141


Can we extend singleton class?

997