Objects and Classes

Related slides on offer

Modeling persons:

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

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

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

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

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