OnJava8-Examples/hiding/IceCream.java
2015-11-03 12:00:44 -08:00

18 lines
325 B
Java

// hiding/IceCream.java
// 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) */