Download Java code and powerpoint from oop01.zip.
As an example we will start the development of a class that represents two-dimensional vectors.
We will call the class Vec2
.
The instance variables are the name of the vector and the (kx, ky) components.
Version 1 illustrates instance variables, set methods and get methods
Version 2 illustrates initializing objects with constructors
Version 2s demonstates using print with objects and the toString
method.
Maintained by John Loomis, last updated 16 December 2020