Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

constructors

 
Puja S
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Constructors can have any access modifiers ( public,protected,default and private ). Can anybody correct me if I'm wrong ?

Also, Top-Level class can be public,default,final and abstract. Please correct me if I'm wrong ?

Thanks.
 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are correct puja ...

one more addition - top-level class may also have strictfp .
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also note that "abstract" cannot be used in conjunction with "final" or "strictfp."

(And, of course, "default" is not technically a modifier.)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic