Objects and Classes

Related slides on offer

Modeling persons:

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

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

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

Figure 202. 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 203. Rectangle class and instances Slide presentation Create comment in forum
Rectangle class and instances

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