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 is the major difference between linkedlist and arraylist?
What is anagram word?
What is integer size in java?
List the interfaces which extends collection interface?
What are byte codes?
Can we have static methods in an interface?
What is the default execution method in java?
What does file separator do in java?
What is the list interface in java programming?
Can we serialize static variables in java?
Is upper case in java?
What is callablestatement? How you can call stored procedure to pass in parameter?
What do you mean by an interface in java?
What are the two types of java?
What is lambda expression in java?