Objects and Classes

Related slides on offer

Modeling persons:

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

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

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

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

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