• Post Reply Bookmark Topic Watch Topic
  • New Topic

Access modifier for no-args constructor

Glenn Gould
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 989
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!