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

In first statement String s = "vijay"

Means it will create a single instance and single reference
variable

but in second statement

String s = new String("vijay");

Means it will create a two instances and single reference
variable

Is This Answer Correct ?    4 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can an interface extend a class?

980


What are internal and external variables?

951


What is the list interface in java programming?

1105


Explain the polymorphism principle?

1005


Explain the concept of proper inheritance?

1064


What is the use of 'super' keyword inside a constructor?

962


What are new features introduced with java 8 ?

984


How to do encapsulation in java?

1049


what happens when a thread cannot acquire a lock on an object? : Java thread

1048


Difference between overriding and overloading in java?

1064


Write code of any action class?

1006


What's the purpose of using break in each case of switch statement?

973


How to set the permissions to a file in java?

982


What are the different conditional statements?

985


What does split function do in java?

1011