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. hi,
i need to connect to server named xxx,i

View Tutorial          By: annamalai at 2012-05-21 10:09:52

2. This is a good tutorial. Now how can I send SMS mu
View Tutorial          By: Alkesh at 2013-05-11 14:51:53

3. Copy the javax.comm.properties into your $JAVA_HOM
View Tutorial          By: sophie at 2009-03-11 08:23:25

4. need to be place taglig in the <jsp-config>
View Tutorial          By: Shaik Basha at 2013-01-30 03:11:41

5. everything is easy to learn from your website.I un
View Tutorial          By: sumitra barua at 2012-05-30 03:13:10

6. Currently am working in Perl, lik to learn Java, n
View Tutorial          By: KUMARESAN at 2011-12-14 05:08:47

7. i have a problem ie., Animal is the super class an
View Tutorial          By: renuka at 2012-08-29 15:08:33

8. Thanks, Just what i was looking for.
View Tutorial          By: Baapu at 2009-10-21 15:21:43

9. Thank You , It's Very Good.
View Tutorial          By: Jack at 2012-06-10 14:09:24

10. Hai,
dis is anu, dng final year. i need to

View Tutorial          By: anu at 2012-07-12 15:41:19