Comment on Tutorial - clone() and the Cloneable Interface in Java By Henry



Comment Added by : siva kiran

Comment Added at : 2011-01-20 11:40:23

Comment on Tutorial : clone() and the Cloneable Interface in Java By Henry
Question: if clone is a protected method then why the sub class has to implement Cloneable interface type to use its super class method?
Answer: clone is a dangerous method. So by implementing Cloneable interface you are telling JVM that "There is a good reason to clone my class, so please allow me"


View Tutorial



Subscribe to Tutorials

Related Tutorials

Program using concept of byte long short and int in java

Update contents of a file within a jar file

Tomcat and httpd configured in port 8080 and 80

Java File

Java String

Count number of vowels, consonants and digits in a String in Java

Reverse a number in Java

Student marks calculation program in Java

Handling Fractions in Java

Calculate gross salary in Java

Calculate average sale of the week in Java

Vector in Java - Sample Program

MultiLevel Inheritance sample in Java

Multiple Inheritance sample in Java

Java program using Method Overriding

Archived Comments

1. Good one ! and simple tutorial
View Tutorial          By: Sim at 2011-02-24 01:57:53

2. I run the code . It's good.
View Tutorial          By: Golam Rabbi at 2011-07-12 07:06:00

3. help
View Tutorial          By: sne at 2012-08-10 07:13:28

4. Thank you very much for explaning the things in su
View Tutorial          By: Sunil Yadav at 2010-05-27 04:04:31

5. in this statement "void Reverse(string &t
View Tutorial          By: vinay at 2012-12-13 16:41:59

6. I need complete steps for execution
Severa

View Tutorial          By: DASAn at 2011-08-10 10:10:36

7. I am a B. Tech. (ECE) student, can i also give scj
View Tutorial          By: Sneha Agarwal at 2013-07-11 08:10:17

8. Error loading SolarisSerial: java.lang.Unsatisfied
View Tutorial          By: koteshwar at 2011-02-05 05:33:19

9. thanks!!
View Tutorial          By: eoko at 2011-05-10 23:34:29

10. so if you then wanted to send this gzencoded data
View Tutorial          By: Mike at 2009-03-18 12:12:28