my dog learned polymorphism
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

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
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

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: 989
I agree. Here's the link:
subject: Access modifier for no-args constructor
It's not a secret anymore!