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 are the super most classes for all the streams?
Why do we need wrapper classes?
What is the benefit of inner classes in java?
How can u increase the heap size in the memory?
What is scope of a variable?
How do you invoke a method?
what are different ways in which a thread can enter the waiting state? : Java thread
23. Storage space in java is of the form Stack Queue Heap List 24. What is java code embedded in a web page known as Applets Servlets scriptlets snippets 25. Which of the following attributes are compulsory with an
What are meta-annotations?
What is a method declaration?
What is boolean keyword in java?
How do you override a method in java?
How will you compute size of a structure?
What is the static method?
Is overriding possible in java?