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 callablestatement? How you can call stored procedure to pass in parameter?
What is the purpose of the runtime class in java programming?
What is number data type in java?
Why enumeration is faster than iterator?
Explain the importance of finally block in java?
What is set string?
FOR EXAMPLE WE R HAVING TWO LIST ELEMENTS ..BOTH LISTS CONTAINS ID,NAME,PLACE ..I NEED TO COMPARE BOTH IDS IN TWO LISTS,IF ID'S R SAME MEANS WE HAVE ADD THE DETAILS(LIKE NAME,PLACE) TO MAP...HOW IS POSSIBLE ?CAN ANY ONE SUGGEST?
What is native method in java?
How do you get the length of a string in java?
What is method overriding in java ?
What are the differences between include directive and include action?
describe method overloading
What is ‘has a’’ relationship in java?
What is the exact difference in between Unicast and Multicast object?
Is it possible to write a regular expression to check if string is a number?