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. Verrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
View Tutorial          By: Amarnath.A at 2011-07-14 00:32:08

2. semicolon(*;) is missed in first line..con .close(
View Tutorial          By: Reddymalla Babu Sircilla at 2013-02-22 09:01:29

3. Can anyone post the steps to implement everything
View Tutorial          By: Matt at 2010-04-29 14:47:11

4. Hibernate can be an effective framework if one app
View Tutorial          By: Giao Vu at 2011-08-03 23:40:02

5. hey pls tel me, what is the advantage of method ov
View Tutorial          By: divya at 2013-08-27 14:20:22

6. I did'nt manage to run the program . I've added th
View Tutorial          By: Bull at 2012-01-01 16:28:20

7. Amazing tutorial!! This is what I was exactly look
View Tutorial          By: Sumanth Vaidya at 2015-06-17 18:19:16

8. Thanks for this section. Clears most of my doubts.
View Tutorial          By: Melvin at 2008-07-05 04:54:19

9. How to use Shift operators with practicals in java
View Tutorial          By: RosyKrish at 2013-01-17 02:42:37

10. Thank you....
View Tutorial          By: Prakash at 2013-02-13 08:35:12