Answer Posted / raga
While creating class objects of which will be immutable. The following
things should be kept in mind:
1. Class should be made final so that no class can extend it.
2. Access modifiers of the instance variables must be private so that no
object can have access to it.
3. There should not be any public set method which can change the state of
the object.
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What does super keyword do?
Is string serializable in java?
What is the difference between multiple processes and multiple threads?
What are operators and its types?
When a lot of changes are required in data, which one should be a preference to be used? String or stringbuffer?
Explain differences between checked and unchecked exceptions in java?
What are the 4 versions of java?
Difference between linkedlist and arraylist.
What is dynamic binding(late binding)?
What is variable and its types?
What is meant by data hiding/encapsulation?
Does unicode support all languages?
What is a conditional equation?
What is executor memory?
What are the differences between Java 1.0 and Java 2.0?