Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 987911
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T05:33:32+00:00 2026-05-16T05:33:32+00:00

Java doc says – The class Object does not itself implement the interface Cloneable,

  • 0

Java doc says –

The class Object does not itself
implement the interface Cloneable, so
calling the clone method on an object
whose class is Object will result in
throwing an exception at run time.

Which is why clone method in Object class is protected ? is that so ?

That means any class which doesn’t implement cloneable will throw CloneNotSupported exception when its clone method is invoked.

I ran a test program

public class Test extends ABC implements Cloneable{

    @Override
    public Object clone() throws CloneNotSupportedException {
        System.out.println("calling super.clone");
            return super.clone();
    }

    public static void main(String[] args) {
        Test t = new Test();
        try{
        t.clone();
        }
        catch (Exception e) {
            e.printStackTrace();
        }
    }
}
class ABC{

}

From Class Test’s clone method super.clone is being invoked ?

Why doesn’t it throw exception ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T05:33:32+00:00Added an answer on May 16, 2026 at 5:33 am

    Inheritance tree of the Test instance t looks like

    Object
      ABC
        Test
    

    Test also implements Cloneable which means that when you call the method super.clone() Object‘s clone method will be called. It checks if the instance t implements the Cloneable interface. Since it does implement the method doesn’t throw an exception.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

1.Does dynamic proxy instance subclass the target class? The java doc says the proxy
From the doc of Java about Hashtable class, it says As a general rule,
The java doc says the append method is thread safe. However, I recall that
The Java doc describe that the constructor Date(long date) constructs a Date object using
Just for learning's sake, I tried in java doc but I did not find
The Timer ( java.util.Timer ) doc describes the cancel method as one that affects
The lastIndexOf() method of List interface accepts a parameter which is of type Object.
During navigation of the java.lang.reflect.Method class I came across the method isBridge . Its
Primitive Data Types - oracle doc says the range of long in Java is
JavaDoc for java.io.FileDescriptor.FileDescriptor() says: Constructs an (invalid) FileDescriptor object. If there is no purpose

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.