• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what is synthetic field is java

 
narasimharao konjeti
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here In java, I have one new variable type, i.e. synthetic field, which is declared like this
static int class$int$boolean$float /*synthetic variable*/
can i know exactly, what is this.
regards
nr konjeti
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not at all sure about the declaration you're showing (maybe somebody else recognizes this crazy notation) but a variable with a "synthetic" attribute means a variable introduced by the compiler that doesn't appear in the actual code. Examples include a static variable to hold a Class object if you've used the "Integer.class" notation, and the member variable in a non-static inner class that holds a reference to the enclosing class. Besides the fact that they are inserted by the compiler, synthetic variables aren't special in any way. Debuggers are supposed to take the synthetic attribute as a hint that they shouldn't display the variable.
 
a young
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had the same question earlier today when looking at some decompiled code. This URL helped me out: http://www.javaspecialists.co.za/archive/Issue062.html
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic