Answer Posted / cm
1. Mark the class as 'final' to avoid any
subclassing/overriding
2. Make the fields as 'private' & 'final' to avoid
reassining in any way after creation of the object by
passing params via contructor
| Is This Answer Correct ? | 17 Yes | 3 No |
Post New Answer View All Answers
Does java map allow duplicates?
What is java english?
What is the difference between Array and Hash Table?
What is logical variable?
How many types of memory areas are allocated by JVM in java?
What is basic syntax?
Can a static block throw exception?
Differentiate between the constructors and methods in java?
What is the meaning of course?
Can we overload the methods by making them static?
Can java inner class be static?
Difference between java and javascript
Is there any difference between nested classes and inner classes?
Can you start a thread twice in Java?
Explain thread in java?