2 | 0 |
By: [email protected] On: Mon Mar 27 14:58:23 IST 2017 0 0 0 | 0 |
Are You Satisfied :0Yes0No |
A. Using new keyword This is the most common way to create an object in java. B. Using Class.forName() If we know the name of the class & if it has a public default constructor we can create an object in this way. MyObject object = (MyObject) Class.forName("subin.rnd.MyObject").newInstance(); C. Using clone() The clone() can be used to create a copy of an existing object. MyObject anotherObject = new MyObject(); MyObject object = (MyObject) anotherObject.clone(); D. Using object deserialization Object deserialization is nothing but creating an object from its serialized form. | 0 |
By: [email protected] On: Mon Mar 27 15:41:40 IST 2017 0 0 0 | 0 |
Are You Satisfied :0Yes0No |