Answer Posted / sudhakar sahoo
1.Mark the class as final to avoid subclass, So subclass
can't change any thing in super class.
2. When ever you are chaning any property of that class
make a new instance of that calss.
e.g public modify(Object obj0)
{
ClassName a =new ClassName ();
a.modify()// modification logioc
}
| Is This Answer Correct ? | 3 Yes | 5 No |
Post New Answer View All Answers
What is floor in java?
Is alive method in java?
Which number is denoted by leading zero in java?
How can you generate random numbers in java?
What is formatted output?
Is arraylist zero based?
What is enhanced loop in java?
How do you do exponents in java?
How to sort an array from smallest to largest java?
Is it possible to specify multiple jndi names when deploying an ejb?
How do you sort in descending order in java using collections sort?
What is java util concurrentmodificationexception?
What is the reason behind using constructors and destructors?
What is a platform?
Which graphs are functions?