Answer Posted / al rahid
1. Declare the Class as final (this inherently makes all
member function final)
2. Declare member variables private (not necessarily final,
because private instance variable are accessed via public
member functions only, e.g. in java.lang.String class,
variable "hash" is declared as "private int hash;" with no
final keyword).
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
What is a default constructor and also define copy contrucyor?
What is a method type?
How do you initialize an arraylist in java?
What is the use of isempty in java?
How do you detect memory leaks?
What are java methods?
How many bytes is 255 characters?
What is the difference between checked exception and unchecked exception?
What is unmodifiable list in java?
why Java does not support multiple inheritances?
What is meant by collection in java?
How many arguments can a method have java?
Write a java program to count the number of words present in a string?
what is the significance of listiterator in java?
What is difference between protected and private?