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 e java?
How do you override a method in java?
Can we use synchronized block for primitives?
What are the four integer types supported by java?
Can a final method be overloaded?
What does isempty () do in java?
Can java arraylist hold different types?
Can we use a switch statement with strings?
How can you say java is object oriented?
What is java util?
What is variable in java?
Do you know why doesn't the java library use a randomized version of quicksort?
what is the major difference between linkedlist and arraylist in java?
How will you print number in reverse (descending) order in BST.
What is the difference between math floor and math round?