Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Is java immutable? Why?  RSS feed

 
Naik Priyanks
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please let me know if java is immutable language.
Also please let me know the merits and demerits for keeping java immutable
 
Vijayendra V Rao
Ranch Hand
Posts: 195
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No offense...but the question makes absolutely no sense in any way. Could you please make your question more clear. What exactly do you mean when you refer to Java as "immutable"?!!!
 
Jimmy Die
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ya, this question could be more specific.

Java is a newer programming language. You can design your own components within java. So from this aspect it is not immutable.

The language as a whole can be changed via the java community process. You or anyone can recomend that components are changed. The suggestions are then reviewed by the members and if accepted they will be part of the new release. Check out the sitejcp
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The word immutable is applied to particular objects rather than the language. There it means that once you have created an object you cannot change its internal state. String is the classic example. Once you have a String object you cannot change the values inside it.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!