Explain the use of Clonable,and serializable interface.

Explain the use of Clonable,and serializable interface.

The similarity of Clonable and Serializable interfaces is that they both are marker interfaces.

Clonable: It is just an indicatory that a class is to use clone() method of the Object class to copy the instance of a particular class.

Serializable: An object of a class is converted into byte stream and persisted in a local disk. It is useful to send the objects in a network as a byte stream. Another network could convert the byte stream into Object of a particular class type.
How do we allocate an array dynamically in java?
Arrays in java are static lists that can store a certain kind of variables. Therefore these arrays need to be initialized at the compile time....
Explain how to initialize an array of objects
An array can be instantiatd in various ways as follows.
How and when can we cast from one class to another?
Java allows us to cast variables of one type to another as long as the casting happens between compatible data types.......
Post your comment