1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
| public class SalariedEmployee extends Employee { private double weeklySalary;
private String color;
public int info2;
private class Inner { private double hour;
public double getWeeklySalary() { return weeklySalary; } }
private Inner inner = new Inner();
public double do_something_inner_class() { inner.hour = 3; return inner.getWeeklySalary(); }
public void do_something_supre_class() { firm = "3"; info = "$"; }
@Override public void describeShape() { System.out.println("hhh"); }
public static void main(String[] args) { SalariedEmployee e = new SalariedEmployee(); e.describeShape(); System.out.println(e.info2); System.out.println(((Employee)e).info2); } }
|