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
What is qms certification?
Can a private method of a superclass be declared within a subclass?
What does arrays sort do in java?
What is a stack class in java ?
How will you communicate between two applets?
What are the different ways of creating thread?
What invokes a thread's run() method in java programming?
Is string is a data type in java?
What is close method? How it's different from Finalize & Dispose?
What does a void function return?
How do generics work?
What are the types of methodology?
How do you represent a space in regex java?
Can we call virtual funciton in a constructor ?
What is the purpose of the file class in java programming?