Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What is difference between Top Level Class and Super Class?

 
Hanuma Deepak Muvvala
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the ejb core specifications document in many places for defining rules of a bean they have mentioned 2 points(almost for all beans)

1. The class must be a top level class.

2.The session bean class may have superclasses and/or superinterfaces.

by reading second point I got confused about first point. I dont know what is difference Top Level Class and Super Class.

Can any body explain?

Thanks ............
Deepak.
 
Balaji Ramalingam
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
According to my understanding, top level class will not have any super class.

Where as super class can have another super class.

hope it helps.
 
Vijaya Raghava
Ranch Hand
Posts: 37
Java Spring Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Top-level classes can only have public, abstract, and final modifiers, and it is also possible to not define any class modifiers at all.

private, protected, and static modifiers cannot be used when declaring
top-level classes.

More than one top-level class can be defined in a Java source file, but there can be AT MOST ONE public top-level class declaration.

Most importantly a TOP LEVEL CLASS' NAME MUST MATCH WITH THE FILE NAME. OTHERWISE THE COMPILER WILL COMPLAIN ABOUT THE SAME.

Now you can understand what is a super class....

Regards,
Vijaya Raghava
 
Hanuma Deepak Muvvala
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Thank you all, now I am clear Top level class is non inner class and super class is a normal super class...

Thanks,
Deepak.....
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic