Answer Posted / kanchan
1. Don't provide any methods that modify the object
2. Ensure that no methods may be overridden. This prevents
careless or malicious subclasses from compromising the
immutable behavior of the class. Preventing
method overrides is generally done by making the class final
3. Make all fields final.
4. Make all fields private. This prevents clients from
modifying fields directly.
Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
What are annotations in java?
What do you mean by an interface in java?
What is method and methodology?
Is the empty set a singleton?
Is java same as core java?
How will you communicate between two applets?
What is a static class in java?
How do you sort a string in alphabetical order in java?
How is final different from finally and finalize?
What are the 4 types of characters?
What is immutability in java?
List two java ide’s?
What do you mean by a JVM?
What is an abstract class and what is it’s purpose?
Can an interface implement another interface?