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
What is java console application?
What is the largest number a double can hold?
Why super is first line in java?
What is the destroy method?
What is a class variable?
What is the difference between inner class and nested class?
Can a abstract class be declared final?
Discuss different types of errors that generally occur while programming.
What is var keyword ?
What is a literal coding?
What does escaping a character mean?
Is null in java?
Difference between collection, collection and collections in java?
What is the difference between a switch statement and an if statement?
Explain the importance of join() method in thread class?