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 are computer functions?

889


Can we make constructors static?

1182


Explain about public and private access specifiers?

982


What are annotations in java?

1043


how we can make a read-only class in java?

943


What is passed by reference and pass by value ?

992


What is meant by distributed application? Why are we using that in our application?

916


Where and how can you use a private constructor?

936


Can we declare array without size in java?

967


What is json parser in java?

1017


What is meant by data hiding in java?

1089


What is use of valueof () in java?

1003


What are the various access specifiers for java classes?

1012


What is default constructors?

942


What is finalize()?

1127