top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What is immutable object? Can you write immutable object?

+1 vote
321 views
What is immutable object? Can you write immutable object?
posted Jan 23, 2017 by Dhaval Vaghela

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

Immutable Objects are those objects whose state can not be changed once they are created, for example the String class is an immutable class. Immutable objects can not be modified so they are also thread safe in concurrent execution. Features of immutable classes: simple to construct.

answer Jan 23, 2017 by Karthick.c
Similar Questions
+2 votes

Object Persistence as Non-Serializable
Assume that the Java programming languae does not have the serializable feature (or you want to mimic
the serializable feature manually).
Discuss the approach where you will need to write the object's state (the values of all member feilds of an
object) to a textfile.
State all possible cases where the manual approach will have pitfalls(at some instance, the manual
approach may either potentially fail or certainly will fail).

+1 vote

Java is a purely Object Oriented programming language or not.......?
If Not
Then write a program without class & objects.......

...