• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

default constructor access modifier

 
dx wu
Ranch Hand
Posts: 60
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,friends:
I am confused what's the default constructor access modifier. public or package-friendly,or others?

thanks!
 
Netty poestel
Ranch Hand
Posts: 131
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
isn't that the "zero parameter constructor" and afaik, it's behind the scenes,undercover...so one need not worry about it since the compiler inserts one for free...[provided If you don't create constructors of your own ]
There's a good article about this on "http://www.jchq.net/certkey/0103certkey.htm"

HTH
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The default constructor (that provided by the compiler when the programmer specifies no constructors) is given the same access modifer of the class for which it is defined.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic