Answer Posted / raga
While creating class objects of which will be immutable. The following
things should be kept in mind:
1. Class should be made final so that no class can extend it.
2. Access modifiers of the instance variables must be private so that no
object can have access to it.
3. There should not be any public set method which can change the state of
the object.
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Can we define private and protected modifiers for the members in interfaces?
This abstract class is correct ? abstract class A { public abstract void Disp(); public abstract void B() { } public absract virtual C() { } }
What are filterstreams?
Does java arraylist maintain insertion order?
What is java beans?
What do you mean by checked exceptions?
What does s mean in regex?
What is an enumeration?
What is difference between == and === in js?
What is java developer skills?
Can you explain the cs option of java interpreter?
Can you add null to a list java?
What is use of arraylist in java?
What is the maximum size of hashmap in java?
How do you break a loop?