public class ProtectTst { public static void main(String[] args) { Son s = new Son(10.0); System.out.println("Son's = " + s.showM()); s.inheritMoney(); System.out.println("Son's = " + s.showM()); } } class Father { protected double money; // what if private? public Father(double money) { this.money = money; } public double showM() { return money; } } class Son extends Father { private double money; public Son(double money) { super(10.0); this.money = money; } public void inheritMoney() { this.money += super.money; } public double showM() { return this.money; } }