Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

What is synthetic class?  RSS feed

 
Hardik Trivedi
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all genius people,

Can anyone explain me what is Synthetic class in java?
 
Campbell Ritchie
Sheriff
Posts: 55324
157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hardik Trivedi wrote:Hi all genius people
No need to be sarcastic.

Have you searched anywhere?
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think anybody was being rude/sarcastic.
 
Hardik Trivedi
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey,
First of all I am not being sarcastic. OK.

And I searched a lot about synthetic class,but only thing I found is it is related to $..
Some where in class file $ sign is put.And it is a class created runtime by JVM.
 
Hardik Trivedi
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A people who know little bit of Java is just genius and a person with marvelous brain power.
 
Rob Spoor
Sheriff
Posts: 21047
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You overestimate us. Well, all but me of course
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16007
87
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A synthetic class (or method) is a class (or method) that is generated by the compiler. For example, if you create an anonymous inner class in your code, like this:

Sun's Java compiler will create two class files when you compile this: MyClass.class and MyClass$1.class. The second one, with the $1, is a class that the compiler generates for your anonymous inner class.

Normally you don't need to deal with synthetic classes or methods when you're a Java programmer.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!