2015-09-07 11:44:36 -06:00
|
|
|
// hiding/IceCream.java
|
2015-06-15 17:47:35 -07:00
|
|
|
// 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();
|
|
|
|
}
|
2015-09-07 11:44:36 -06:00
|
|
|
}
|
|
|
|
/* Output: (None) */
|