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 immutable? right every one knows that, my
question is it advantage or disadvantage making string
immutable?

Answers were Sorted based on User's Feedback



string is immutable? right every one knows that, my question is it advantage or disadvantage makin..

Answer / payal gupta

It is an advantage that a String class is immutable because
almost all the standard classes use its methods, if they
were mutable, then the behaviour of other standard classes
and their methods would not have been consistent.

Is This Answer Correct ?    7 Yes 7 No

string is immutable? right every one knows that, my question is it advantage or disadvantage makin..

Answer / vinod kumar

It is an advantage
performance: knowing that a string is immutable makes it
easy to lay it out at construction time — fixed and
unchanging storage requirements

Is This Answer Correct ?    3 Yes 3 No

string is immutable? right every one knows that, my question is it advantage or disadvantage makin..

Answer / prashant renge

It is advantage,
because String is standard class,if it is muttable
behaviour is inconsistant.

Is This Answer Correct ?    2 Yes 2 No

string is immutable? right every one knows that, my question is it advantage or disadvantage makin..

Answer / chandu

Sting is Immutable.We can make String as mutable in the give ex
String s="Hello";
String s=s1;
String s2;
s2=s1.append("World");

Is This Answer Correct ?    1 Yes 2 No

string is immutable? right every one knows that, my question is it advantage or disadvantage makin..

Answer / ashish balhara

The performance for String is poor as compared to String
Buffer, as internally (for eg. a simple operation like + on
String), it generates String Buffer, calls append operation
(eqvt. of + in String) & converts result back to String.
Hence extra bytecode is generated which could be done away
with.

Is This Answer Correct ?    0 Yes 5 No

Post New Answer

More Core Java Interview Questions

What are packages and name a few?

4 Answers  


What is outofmemoryerror in java?

0 Answers   Cyient,


What do you mean by checked exceptions?

0 Answers  


Explain, why the constructor is required in implemented class?

4 Answers  


What is the difference between a public and a non-public class?

2 Answers  


C and C++ has constructors and distructors, why does Java does not have distructors?

1 Answers   T3 Softwares,


How many types of interfaces are there?

0 Answers  


How many types of exception can occur in a java program?

0 Answers  


Explain about wait() method?

0 Answers  


What data structures are used to perform recursion?

0 Answers   Akamai Technologies,


What is the importance of hashcode() and equals() methods?

0 Answers  


Can arraylist hold different types java?

0 Answers  


Categories