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

What is a pointer and does java support pointers?

964


What is a string token?

970


What is considered an anti pattern?

881


What is byte code and why is it important to java’s use for internet programming?

1063


How are variables stored?

932


What is meant by the value of a variable?

870


What does += mean in java?

1022


How to display all the prime numbers between 1 and n (n is the number, get the input from user)

933


Make a data structure and implement an algorithm to print all the files in a directory. (The root directory can have sub-directories too.)

1288


Why hashmap is used in java?

1024


How to reverse string in java?

1142


What is string data?

947


What are dot operator queries?

1064


What is the use of list in java?

940


What is the diffrence between inner class and nested class?

1032