Objects and Classes

Related slides on offer

Modeling persons:

Figure 177. Instances of a Class Slide presentation
Instances of a Class

Figure 178. General class structure Slide presentation
General class structure

Figure 179. What's a class anyway? Slide presentation

In object oriented languages classes:

  • are blueprints for objects.

  • contain attributes and methods.

  • allow for implementation hiding.

  • allow for tailored access to methods and attributes.

Figure 180. Rectangle objects Slide presentation
Rectangle objects

Figure 181. A class describing rectangles Slide presentation
public class Rectangle {
  int width;
  int height;

  // solid or dashed:
  boolean hasSolidBorder;
A class describing rectangles

Figure 182. Rectangle class and instances Slide presentation

Figure 183. Generated diagrams Slide presentation
Generated diagrams
Generated diagrams