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



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 Example program is very useful.
good w

View Tutorial          By: sathya at 2008-03-28 02:21:41

2. its superb
View Tutorial          By: chotu jain at 2011-05-24 08:47:22

3. Please, I need help, how can i write a program &qu
View Tutorial          By: LULU at 2012-11-23 01:34:07

4. It is clear but at the starting code there is a wr
View Tutorial          By: Kiranmoy Pradhan at 2015-08-20 21:55:15

5. I need a payroll system program in c++ using class
View Tutorial          By: tesfay at 2012-01-19 12:08:55

6. easy to understand
View Tutorial          By: shanthi at 2011-01-02 21:25:51

7. steps 2 create and use tiles
View Tutorial          By: sasank at 2008-10-03 08:06:43

8. i totally disagree with Gerardo Saldív
View Tutorial          By: Shivesh at 2009-09-24 23:46:42

9. very nice but i want some more exapmles
View Tutorial          By: prasad lengare at 2010-10-03 23:12:47

10. Hi I properly placed the Comm api settings,i have
View Tutorial          By: Muthumani at 2010-04-19 05:24:17