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
Is a copy constructor?
Why arraylist is used in java?
Can we override static methods in java?
What is :: operator in java 8?
What is a null point?
Explain about public and private access specifiers?
What are the different types of multitasking?
Difference between linkedlist and arraylist.
Is string pool garbage collected?
What are different types of multitasking?
What kind of variables a class can consist of?
Can a class be private?
What are the supported platforms by java programming language?
What is the difference between an object-oriented programming language and object-based programming language?
What is finalize method?