• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Bear Bibeault
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • salvin francis
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
Bartenders:
  • Jj Roberts
  • Carey Brown
  • Scott Selikoff

What is difference between Top Level Class and Super Class?

 
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 37
Spring Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Deepak Mula
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.....
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic