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 8177443
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T23:30:41+00:00 2026-06-06T23:30:41+00:00

When i try to clone a generic Object i get compile time error .

  • 0

When i try to clone a generic Object i get compile time error . why?

    Object obj=new Object();
    obj.clone();  // Here compile time error "The method clone() from the type Object is not visible"

Every class extends Object class and clone method is protected in Object class.

protected methods can be accessed in same package as well as by subclasses and all classes are child of java.lang.Object.

  • 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-06-06T23:30:43+00:00Added an answer on June 6, 2026 at 11:30 pm

    Because clone is protected in the Object class. It’s not public.

    The only way to get access to an object’s clone() method is to know it has a compile-time type that has a public clone() method.

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

Sidebar

Related Questions

I'm writting a client(Android) - server(c#) application. I get the code from here: How
I try using evt.parent.attr(id) inside jsddm_close, but it doesn't work. <script type=text/javascript src=http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js></script> <script
try: html = urlopen('http://glbse.com/api/asset/' + asset.name) except: print 'error while updating the price of
try { JSONArray jArray = new JSONArray(result); for(int i=0;i<jArray.length();i++) { JSONObject json_data = jArray.getJSONObject(i);
I'm not sure what exactly i'm doing wrong here...but i noticed that my File.Move()
I try to create a generic interface that inherits the System.ICloneable interface but where
This question comes from a code analysis run against an object I've created. The
I'll try to clarify by using the following example. In here I have two
I have 2 classes. With the Generic Data Access class I can get the
Working on a basic C# web app here and I can't seem to get

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.