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...

String is an immutable object.
Then how can the following code be justified.

String s1 = ?ABC?;
String s1 = s1+?XYZ?;
s.o.p(s1);

The output is ABCXYZ, which is the value of s1 ?

Answer Posted / sivadasan

It will Give Compile time Error...

We can not declare again s1.

So the Compiler will give

s1 is already defined in main(java.lang.String[])

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which method cannot be overridden in java?

1043


What is supplier in java?

1057


What are the different types of collections in java?

1017


What is the difference between the font and fontmetrics classes in java programming?

1260


What is string substring?

1204


what is the significance of listiterator in java?

1126


Write a java program to print fibonacci series?

1007


Is main is a keyword?

1060


What is java and their uses?

1093


What is the full name of java?

1185


What is runtime polymorphism or dynamic method dispatch?

1051


Can list be final in java?

989


Can a variable be local and static at the same time?

1059


How can u increase the heap size in the memory?

1070


What is a heavyweight component?

1075