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 meant by vector class, dictionary class, hash table class, and property class?
What interface is extended by awt event listeners?
What is the gregoriancalendar class in java programming?
What is the purpose of static keyword in java?
What is currentthread()?
Can memory leak in java?
What is the difference between serializable and externalizable interface?
Is java developer a good career?
How do you reverse sort a list in java?
What is an enumeration?
Are the imports checked for validity at compile time? Will the code containing an import such as java.lang.abcd compile?
Does string isempty check for null?
Why convert an applet to an application?
What is JFC?
Explain the different forms of polymorphism?