A Bit on Super and Sub Classes
As we have talked about in class there are some important
relationships that need to be examined between superclasses and their
subclasses and vice-a-versa. One thing that can be difficult is
making sure you develop the superclasses before you develop your
subclasses so that you can extend them appropriately. You cannot
extend something that doesn't exist.
First we will develop the Point class, then we will develop the Circle class and then we will test them. Now the code for Point.java should be copied into a new directory. // Point.java This is very basic and is the basis of our next class. |
Now we are going to extend this Point class into a subclass
called Circle.
Now the code for Circle.java should be copied into a new directory. // Circle.java Now we have started getting more developed. |
Now you want to copy the following code into a file called TestSubSuper.java in the same directory. // TestSubSuper.java Now you need to execute this java application. |