File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes What is synthetic class? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "What is synthetic class?" Watch "What is synthetic class?" New topic
Author

What is synthetic class?

Hardik Trivedi
Ranch Hand

Joined: Jan 30, 2010
Posts: 252
Hi all genius people,

Can anyone explain me what is Synthetic class in java?
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39415
    
  28
Hardik Trivedi wrote:Hi all genius people
No need to be sarcastic.

Have you searched anywhere?
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

I don't think anybody was being rude/sarcastic.
Hardik Trivedi
Ranch Hand

Joined: Jan 30, 2010
Posts: 252
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

Joined: Jan 30, 2010
Posts: 252
A people who know little bit of Java is just genius and a person with marvelous brain power.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19720
    
  20

You overestimate us. Well, all but me of course


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14270
    
  21

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.

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
 
 
subject: What is synthetic class?