PPT Slide
Inheritance and Scoping
class StaffMember {
String strName;
public StaffMember( ) {
System.out.println (“in default StaffMem constr; No Name”);
setName(“No Name”);
} // of constructor
public StaffMember(String strName) {
System.out.println (“in 2nd StaffMem constructior; have a Name”);
setName(strName);
} // of constructor
public void setName(String strName) {
this.strName = strName;
} // of setName
}// of StaffMember
Previous slide
Next slide
Back to first slide
View graphic version