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. This is the helpful Site for beginner....!!!!!!!!!
View Tutorial          By: Anup at 2013-07-26 13:40:49

2. This is so phat. Maybe the best explanation ever t
View Tutorial          By: Devin Prince III at 2010-08-11 10:01:04

3. I have a mac book dual booting with snow leopard (
View Tutorial          By: david at 2015-06-27 15:33:07

4. super example...it very useful for me...
View Tutorial          By: elan at 2011-06-02 07:54:39

5. very helpful & gud tutorial...
thanks..

View Tutorial          By: Narpinder Sharma at 2011-06-27 03:12:20

6. Thanks bro...you save me from a great problem...ve
View Tutorial          By: Tishan at 2012-07-09 09:14:07

7. pls help me .....its hard to understand for me th
View Tutorial          By: heidi at 2010-06-27 02:31:29

8. Simple file writer example. .............
<

View Tutorial          By: Chezhian TK at 2010-10-14 21:40:16

9. Thanks.. worked perfectly :)
View Tutorial          By: DJ at 2012-04-05 19:40:43

10. I want an example...to get multiple values using S
View Tutorial          By: Madhu at 2015-07-13 19:57:14