Forums Register Login

What is difference between Top Level Class and Super Class?

+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
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.....
We're all out of roofs. But we still have tiny ads:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1004 times.
Similar Threads
Implementing a nested toplevel interface
Top level Class
Inner classes
Inner Class definition per JLS
Inner class extends
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 03:50:35.