package examples; /** * CS 0401 * Simple class to demonstrate inheritance and access restrictions. See * also SubClass.java * * @author Dr. Ramirez * */ public class SuperClass { private int pri; // accessible only within this class public int pub; // accessible everywhere protected int pro; // accessible within this class and any subclasses public SuperClass(int a, int b, int c) { pri = a; pub = b; pro = c; } // Some simple mutators -- see SubClass.java and ex18.java for more info // one these public void mutatePri(int a) { pri = a; } public void mutatePro(int b) { pro = b; } public void mutatePub(int c) { pub = c; } public String toString() { return new String("pri: " + pri + " pro: " + pro + " pub: " + pub); } }