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

What is vector capacity in java?

1085


How is java hashmap implemented?

1032


Can we create an object of static class in java?

1018


What is data member in java?

1050


What is meant by bytecode?

1030


What is charat ()?

932


What is concurrent hashmap and its features?

1096


What is the difference between C++ and Java and your preferences?

1113


Why to use nested classes in java? (Or) what is the purpose of nested class in java?

1072


What is a lambda expression ? What's its use ?

1108


Is it safe to install java on my computer?

1143


What is meant by class loader? How many types are there? When will we use them?

973


What are the disadvantages of object oriented programming?

1279


Can singleton class be cloned?

1052


How can we run a java program without making any object?

1045