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

Can we define a package statement after the import statement in java?

1064


Explain purpose of sleep() method in java?

1115


How hashmap increases its size in java?

985


How do you write a scanner class in java?

1013


how to convert Java project into Maven ?

1049


What is arraylist class in java?

1057


What are the different ways of creating thread?

1007


Explain about member inner classes?

1096


What is the difference between iterator and list iterator?

1030


What is java algorithm?

930


When object is created and destroyed?

1100


What does \ mean in regex?

1209


Is upper case in java?

956


How to change the priority of thread or how to set priority of thread?

1023


How many types of memory areas are allocated by JVM in java?

1067