OnJava8-Examples/access/IceCream.java
2015-05-29 14:18:51 -07:00

18 lines
352 B
Java

//: access/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();
}
} ///:~