1

I'm asking the exact same question as this one, but for Java.

What are all the special methods, fields, etc. that are created by the compiler and are therefore not in the Javadoc? Examples of this are default constructors and the values and valueOf methods added to enums.

Community
  • 1
  • 1
snickers10m
  • 1,709
  • 12
  • 28
  • 1
    There's been a close vote for "too broad". This is a very specific question. Just because people might try to give partial answers does not mean there isn't a specific, correct answer. – snickers10m Nov 06 '15 at 00:58
  • Plus, the question that I linked that is a near-duplicate of this one has over twenty points. Why would this one be closed and not that one? – snickers10m Nov 06 '15 at 00:59
  • "I'm asking the exact same question as ... one [that] has over twenty points." It's possible people are assuming you're asking for the purpose of points, rather than curiosity. In particular, it's unclear to me at least what the benefit of this question would be. Java isn't C++. – dimo414 Nov 06 '15 at 01:13
  • 1
    @dimo414 Java has compiler-constructed member definitions though, a fact that I recently discovered today, and was curious to learn more completely about. And the only reason I mentioned that its nearly identical is so it doesn't get duplicate votes. And the only reason I mentioned the other has over twenty points is because that's evidence that this kind of question is good for this site. So... what's the problem? – snickers10m Nov 06 '15 at 01:16
  • 1
    That question is 5 years old. Standards have changed. – Sotirios Delimanolis Nov 06 '15 at 01:18
  • *shrug*, just offering a possible explanation. It's really not a problem for Java in the same way it might be for C++, and the fact that a question is well received in one context isn't proof it should be in another. – dimo414 Nov 06 '15 at 01:19
  • 1
    Just a description of synthetics would be "too broad". – chrylis -cautiouslyoptimistic- Nov 06 '15 at 01:54
  • 1
    I'm unable to agree with any of this adverse commentary. It's a good question, although implementation-dependent. @chrylis Synthetic methods are easily *mentioned,* which is what he asked for. He hasn't asked for a description, but I don't agree that would be too broad either. – user207421 Nov 06 '15 at 02:55

1 Answers1

1

In addition to what you mentioned:

  • this$0 for the outer object reference of inner classes
  • access$NNN() methods for inner classes
  • bridge methods for overridden methods with generic parameters.
user207421
  • 305,947
  • 44
  • 307
  • 483
  • +1. This is correct, no idea why it was downvoted. [SyntheticTest.java](http://pastebin.com/eqHjKrYV) - [SyntheticTest.class](http://pastebin.com/6pZNdxnj). I probably missed some. – Obicere Nov 06 '15 at 02:18