Objects and Classes

Related slides on offer

Modeling persons:

Figure 208. Instances of a Class Slide presentation Create comment in forum
Instances of a Class

Figure 209. General class structure Slide presentation Create comment in forum
General class structure

Figure 210. What's a class anyway? Slide presentation Create comment in forum

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 211. Rectangle objects Slide presentation Create comment in forum
Rectangle objects

Figure 212. A class describing rectangles Slide presentation Create comment in forum
public class Rectangle {
  int width;
  int height;

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

Figure 213. Rectangle class and instances Slide presentation Create comment in forum

Figure 214. Generated diagrams Slide presentation Create comment in forum
Generated diagrams
Generated diagrams