PPT Slide
Protected Access Solves This Problem
public Dessert(String nameOf) {
public Dessert(String nameOf, int caloriesOf) {
public String nameOf() { return name; }
public int caloriesOf() { return calories; }
public class DessertTest2 {
public static void main (String[] args) {
Cake ccake = new Cake("Linda's Cake");
System.out.println(ccake.nameOf() + ": " + ccake.cakeTypeOf()
+ " " + ccake.caloriesOf() + " " + ccake.frostTypeOf());