aspose file tools*
The moose likes Associate Certification (OCAJP 7/8) 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
JavaRanch » Java Forums » Certification » Associate Certification (OCAJP 7/8)
Bookmark "Access modifier for no-args constructor" Watch "Access modifier for no-args constructor" New topic
Author

Access modifier for no-args constructor

Glenn Gould
Greenhorn

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
Rancher

Joined: Mar 17, 2012
Posts: 892
    
    9
Yes, http://docs.oracle.com/javase/specs/jls/se7/html/jls-8.html#jls-8.8.9
 
 
subject: Access modifier for no-args constructor