Why Clone Method is Protected in Object class


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Why Clone Method is Protected in Object class

  1. #1
    Shailesh Deshpande Guest

    Why Clone Method is Protected in Object class


    Hi,

    Will nay one tell me why clone mthod is having protected signature? By this
    access level, I can not clone the objects in another packages.

    Please reply to this question if anyone knows it. Thanx in advance.

    Shailesh

  2. #2
    MarkN Guest

    Re: Why Clone Method is Protected in Object class


    I don't know for sure but read the comments on the clone method in the Object
    class. You can always add your own method that calls clone.

  3. #3
    Allan Neoh Guest

    Re: Why Clone Method is Protected in Object class


    IMHO, protected would give a choice for subclasses whether
    to expose clone() or not. I hope this makes sense. Not everything
    is cloneable.

    Cheers



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center