«^»
5.7. Providing a new class type in VB.NET

For an example of a class declaration, we now look at how we might represent a point in 2D space.

Note: although the FCL provides a type (System.Drawing.Point) for representing points in 2D space, for the sake of this exercise, we will pretend that it does not exist.

When we design a class declaration, we should think long-term: not about what we need in our current program but about what would be useful in this class so that it could also be used by other programs in the future.

There are two main characteristics to a type:

So when we are choosing how to represent something (e.g., points in 2D space) we need to consider these two characteristics.