/** * @author Shengyang Zhong * @version 1.0 * @date 04.04.2002 * @package informatik2.hello * @class Hello2 */ // division of labor aspects: // the data are in the application class, while // the the functionality resides in the support class; // objects frequently correspond to things in the real world // class = type = collection of attributes // each instance of this class gets its own attributes public class Hello2b { public static void main (String[] argv) { Mouth mouth = new Mouth(); mouth.say("Hello 2b, World!"); } // main } // Hello2b //--------------------- cut into two files ----------------------------- class Mouth { // no static attribute anymore public void say(String what) { System.out.println(what); } // say } // Mouth