How can you avoid serialization in child class if the base class is implementing the serializable interface?
Answer / Prabhakar Awasthi
"By declaring the constructor of the child class as private, you can prevent the creation of new instances from outside the class. Since constructors are not inherited in Java, the child class will not be serialized even if its superclass implements Serializable."
| Is This Answer Correct ? | 0 Yes | 0 No |
Tell us something about different types of casting?
when you will synchronize a piece of your code? : Java thread
Is &&= a valid Java operator?
how to convert Java project into Maven ?
please tell me what is wrapper class in java with example ?
Explain the difference between an object-oriented programming language and object-based programming language?
What if the main() method is declared as private? What happens when the static modifier is removed from the signature of the main() method?
In real time project which driver did u use? What is the main functionality of the Prepared Statement?
What is an example of a boolean?
What is the preferred size of a component?
Explain the difference between abstract class and interface in java?
Describe the process as to how substring() methodology mechanisms in java.