OnJava8-Examples/hiding/IceCream.java
Bruce Eckel 49edcc8b17 reorg
2015-06-15 17:47:35 -07:00

18 lines
371 B
Java

//: hiding/IceCream.java
// ©2015 MindView LLC: see Copyright.txt
// Demonstrates "private" keyword.
class Sundae {
private Sundae() {}
static Sundae makeASundae() {
return new Sundae();
}
}
public class IceCream {
public static void main(String[] args) {
//! Sundae x = new Sundae();
Sundae x = Sundae.makeASundae();
}
} /* Output: (None) *///:~