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. Great stuff!!!

The clickLink functi

View Tutorial          By: Harro at 2008-10-13 07:25:26

2. Hello Friends ,

s1 == s2 will alway

View Tutorial          By: Gunjan at 2010-09-08 19:24:24

3. hmmmmmm good
View Tutorial          By: Haritha chinnu at 2012-06-30 09:37:49

4. give the picture view of connecting vb.net with my
View Tutorial          By: Murugamani at 2014-09-09 06:12:58

5. i am getting the following error when i ran this p
View Tutorial          By: nancy kapoor at 2008-10-07 14:26:21

6. Norman, it would be good to credit where your writ
View Tutorial          By: K&R at 2014-03-20 11:41:56

7. it should be:
/* --------------- */

View Tutorial          By: Ryba at 2010-05-19 15:45:48

8. Please send me the multithreading chat application
View Tutorial          By: Vaibhav at 2010-06-23 23:58:43

9. Hi Ramlak

First of all thanks for u

View Tutorial          By: Vikas sharma at 2010-05-08 01:09:31

10. Hi,

I am new to html, and javascrip

View Tutorial          By: Tom Theriault at 2010-12-14 14:54:09