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 / ravikiran

first one will create an object on the heap
second one will create two objects one will saved on the
heap and another will get saved on the string pool

Is This Answer Correct ?    0 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the primary benefit of encapsulation?

1014


What does sizeof return?

930


What is the common usage of serialization?

1070


Why do we use string?

972


What is a get method?

978


What is main in java?

1064


What are the principle concepts of oops?

909


What is difference between identifier and variable?

998


What is the difference between a method and a function in alice?

1093


What do you understand by garbage collection in Java? Can it be forced to run?

919


Explain the use of shift operator in java. Can you give some examples?

916


Is integer immutable in java?

927


What is the hashcode () and equals () used for?

956


Can we use static class instead of singleton?

1001


How can you share data between two thread in Java?

900