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

Compilation ERROR
Duplicate Variable s1.

Is This Answer Correct ?    2 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is meant by JVM? Is JVM platform independent or not?

1007


Explain why wait(), notify() and notifyall() methods are in object class rather than in the reading class?

923


How to perform bubble sort in java?

949


What is widening and narrowing in java? Discuss with an example.

984


What is use of static method?

990


Why is java so important?

1063


What is concurrent hashmap and its features?

1020


What are the major drawbacks of external iteration?

1012


Why is it called buffering?

1054


How many bytes is a string java?

964


What is a newline character in java?

984


Why is the main method declared static?

1074


Does string is thread-safe in java?

1020


Is list thread safe in java?

873


What is java virtual machine? Explain

966