Skip to content

Commit 4f79533

Browse files
author
Bruce Eckel
committed
added "Package Access vs. Public Constructors" section
1 parent 97dcdeb commit 4f79533

2 files changed

Lines changed: 21 additions & 0 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// hiding/CreatePackageAccessObject.java
2+
// (c)2017 MindView LLC: see Copyright.txt
3+
// We make no guarantees that this code is fit for any purpose.
4+
// Visit http://OnJava8.com for more book information.
5+
// {WillNotCompile}
6+
import hiding.packageaccess.*;
7+
8+
public class CreatePackageAccessObject {
9+
public static void main(String[] args) {
10+
new PublicConstructor();
11+
}
12+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// hiding/packageaccess/PublicConstructor.java
2+
// (c)2017 MindView LLC: see Copyright.txt
3+
// We make no guarantees that this code is fit for any purpose.
4+
// Visit http://OnJava8.com for more book information.
5+
package hiding.packageaccess;
6+
7+
class PublicConstructor {
8+
public PublicConstructor() {}
9+
}

0 commit comments

Comments
 (0)