added "Package Access vs. Public Constructors" section

This commit is contained in:
Bruce Eckel 2017-05-01 15:49:21 -06:00
parent 97dcdebc0c
commit 4f795333a6
2 changed files with 21 additions and 0 deletions

View File

@ -0,0 +1,12 @@
// hiding/CreatePackageAccessObject.java
// (c)2017 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose.
// Visit http://OnJava8.com for more book information.
// {WillNotCompile}
import hiding.packageaccess.*;
public class CreatePackageAccessObject {
public static void main(String[] args) {
new PublicConstructor();
}
}

View File

@ -0,0 +1,9 @@
// hiding/packageaccess/PublicConstructor.java
// (c)2017 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose.
// Visit http://OnJava8.com for more book information.
package hiding.packageaccess;
class PublicConstructor {
public PublicConstructor() {}
}