Search code examples
javaclassmethodssynthetic

Java | What does synthetic mean?


I was going through the java Method.class (Decompiled) and I found something that caught my eye.

@Override
public boolean isSynthetic() {
    return super.isSynthetic();
}

"Synthetic". What does that mean?

Is it usable in code?

.

And since I found this in the Method class, I was wondering, is it that an entire method could be "synthetic", or is it that it contains something synthetic?

Thanks in advance.

.

not a copy of What is the meaning of “static synthetic”?


Solution

  • Any constructs introduced by the compiler that do not have a corresponding construct in the source code must be marked as synthetic, except for default constructors and the class initialization method.

    http://www.javaworld.com/article/2073578/java-s-synthetic-methods.html