Answer Posted / kanchan
To make a class immutable,
1. Don't provide any methods that modify the object.
2. Ensure that no methods may be overridden. Mark the class
as final. Make all fields final and private.
Is This Answer Correct ? | 63 Yes | 1 No |
Post New Answer View All Answers
Why do we declare a class static?
What is an interface in java?
What is natural ordering in java?
How much ram can a 64 bit processor theoretically?
What is return null in java?
What is data member in java?
What is tree in java?
What is a nullable field?
What if static is removed from main method?
A non-static inner class may have object instances that are associated with instances of the class’s outer class. A static inner class does not have any object instances.
How java uses the string and stringbuffer classes?
What is Java Package and which package is imported by default?
How to store image in arraylist in java?
what is meant by Byte code concept in Java?
What do you mean by scope of variable?