/* Program Test_Access2.java demonstrates private modifier */
import mypack.*;

class Manager extends Employee {
	double comm;

	Manager(String s) { super(s); }	// constructor

	String get_name() { return super.getName(); }
	
	public double getSalary() {
// The following line will not compile since salary is private
//		return salary;
// This will work from here. We are subclass of Employee
		return super.getSalary();	// correct
	}
}


class Test_Access2 {
	public static void main(String[] args) {
		Manager m = new Manager("John");
		Employee e = new Employee("Mary");

// Any class can call Employee.getName. It is public
		System.out.println("e.name = " + e.getName());															System.out.println("m.name = " + m.getName());																	

// This will not work since e.getSalary is protected.
//		System.out.println("e.salary = " + e.getSalary());				

// This should work since Manager is in our own package.
		System.out.println("m.salary = " + m.getSalary());				
		}
}


