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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T01:35:03+00:00 2026-06-03T01:35:03+00:00

This one is weird. I have the following code: class A { protected A

  • 0

This one is weird. I have the following code:

class A
{   
    protected A clone() throws CloneNotSupportedException
    {
        return (A) super.clone();       
    }
}

when I de-compiled its bytecode through ‘showmycode.com’, it showed me the following code:

class A
{

    A()
    {
    }

    protected A clone()
    throws clonenotsupportedexception
    {
        return (A)super.clone();
    }

    protected volatile object clone()
    throws clonenotsupportedexception
    {
        return clone();
    }
}

What does it mean for a method return type to be volatile in the second ‘clone’ method? (This code was compiled through Eclipse’s default JDK 1.6 compiler).

  • 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-03T01:35:05+00:00Added an answer on June 3, 2026 at 1:35 am

    The modifier mask for fields and methods is similar but not exactly the same. The decompiler is most likely using the toString method here

    http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/java/lang/reflect/Modifier.java

    but what it doesn’t do is handle all bits

    // Bits not (yet) exposed in the public API either because they
    // have different meanings for fields and methods and there is no
    // way to distinguish between the two in this class, or because
    // they are not Java programming language keywords
    

    What its doesn’t handle is the bits which can mean synthetic and bridge which identify compiler generated code.

    If volatile means anything at all here, it could mean don’t remove the method even though it doesn’t do anything.

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

Sidebar

Related Questions

Boy, this one is really weird. I expect the following code to print 1990,
I have the following code for my universal app but I'm getting this weird
I know this one is the weirdest of all weird questions I have asked
Ok, this is a really weird one. I have an MPI program, where each
Ok, this one is really weird... I can't show code for it exactly cause
The following code demonstrates a weird problem I have in a Turbo C++ Explorer
I have the following code: http://jsfiddle.net/8fvJN/15/ I am getting a very weird effect when
I have an activity with following code. @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);
I have a weird situation here, i have the following grid: @(Html.Telerik().Grid(this.Model). Name(grdEscolas). Groupable().
This is a weird one, but hopefully someone can give me an idea here.

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.