wood burning stoves 2.0*
The moose likes Associate Certification (OCAJP 7) and the fly likes Access modifier for no-args constructor Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Associate Certification (OCAJP 7)
Bookmark "Access modifier for no-args constructor" Watch "Access modifier for no-args constructor" New topic

Access modifier for no-args constructor

Glenn Gould

Joined: Jul 09, 2013
Posts: 5

The default no-arg constructor is created by the compiler implicitly.

Can someone verify the following:

The access type of a default constructor is the same as the access type of the declared class.

So if the class in question is

the default no-args constructor which is implicitly created
will have access modifier "default" (also known as package access).

Please confirm.
Thanks in advance.
E Armitage

Joined: Mar 17, 2012
Posts: 892
Yes, http://docs.oracle.com/javase/specs/jls/se7/html/jls-8.html#jls-8.8.9
I agree. Here's the link: http://aspose.com/file-tools
subject: Access modifier for no-args constructor
Similar Threads
Constructor question
Acceess Modifiers
Implicitly given access modifier
Default constructor
are constructors inherited?