Objects and Classes

Related slides on offer

Modeling persons:

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

Figure 183. General class structure Slide presentation
General class structure

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

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

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

Figure 187. Rectangle class and instances Slide presentation

Figure 188. Generated diagrams Slide presentation
Generated diagrams
Generated diagrams