File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes default constructor access modifier Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "default constructor access modifier" Watch "default constructor access modifier" New topic

default constructor access modifier

dx wu
Ranch Hand

Joined: Apr 28, 2002
Posts: 60
I am confused what's the default constructor access modifier. public or package-friendly,or others?


good good study , day day up!
Netty poestel
Ranch Hand

Joined: Sep 20, 2004
Posts: 131
isn't that the "zero parameter constructor" and afaik, it's behind the scenes, 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 ""

Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
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.

Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
I agree. Here's the link:
subject: default constructor access modifier
jQuery in Action, 3rd edition