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
What types of index data structures can you have in java?
Explain naming conventions for packages?
What is the full meaning of java?
Is arraylist a class in java?
Why do we create threads in java?
Explain about map interface in java?
what is the difference between Object Based Language and Object Oriented Language?
Why is the type for real numbers called double?
What is empty string literal in java?
What are default methods ?
Is map sorted in java?
Can arraylist hold different types java?
How to disable caching on back button of the browser?
What is function declaration?
How many bytes is a string?