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
Can a private method be declared as static?
In how many ways we can create threads in java?
Can you override a final method?
Why java is called not pure object oriented language?
How to reverse string in java?
What is a class object?
In how many ways we can do exception handling in java?
What is the major advantage of external iteration over internal iteration?
Is it possible for a yielded thread to get chance for its execution again?
What does math floor () do?
What is a variable analysis?
What is a copy constructor in java?
What is class variable java?
What is string array?
What are alternatives to java serialization?