COMPSCI 2S03 Lecture Notes - Lecture 16: Aqua Teen Hunger Force (Season 2), Class Diagram
Document Summary
Enum (a special type of class in java): Enums contain constant objects (not strings) enum weekday { It creates an instance of the enum mealtime. Constructor name must be the same as the class name. Association - semantic dependency, weak relationship but unrelated (e. g. a doctor and a patient) Inheritance - simple class and other classes (e. g. animal and cat) Aggregation/composition - part of or composed of (e. g. engine is part of car, but the car contains other parts too) These relationships can be representing using a class diagram. Meantime(int tt, int mm) { private time servingtime; servingtime = new time(tt, mm); Static variables are independent of objects. e. g. non static example: Math. pow(2,4) 16 8 void addb(int[] x, int y);