OnJava8-Examples/hiding/IceCream.java

18 lines
371 B
Java
Raw Normal View History

2015-06-15 17:47:35 -07:00
//: hiding/IceCream.java
// <20>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) *///:~