Objects and Classes

Related slides on offer

Modeling persons:

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

Figure 182. General class structure Slide presentation
General class structure

Figure 183. 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 184. Rectangle objects Slide presentation
Rectangle objects

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

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

Figure 186. Rectangle class and instances Slide presentation

Figure 187. Generated diagrams Slide presentation
Generated diagrams
Generated diagrams