• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

what is synthetic field is java

 
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic