-
Hi,
a simple question. If I have two classes, one of which inherits functionality from the other, is there a particular compiling method. I presumed that I should compile the superclass first then the subclass, but the subclass doesn't find the superclass. Do I have to import it in some way? I'm new to this.
D:\jdk1.2.1\bin>javac ..\..\java\Point.java
D:\jdk1.2.1\bin>javac ..\..\java\Circle.java
..\..\java\Circle.java:4: Superclass Point of class Circl
e not found.
public class Circle extends Point { // inherits from Point
^
1 error
D:\jdk1.2.1\bin>
THANKS
Lenin
-
i think that you would compile the subclass first, and then the super class.
-
How so? The subclass extends the superclass, compiling the subclass would mean it has no know;edge of the superclass??
-
Im pretty sure that you only compile the super
class and then any class or classes the extend off of it
are compile automatically. But if the classes are in
diffrent files you have to add an import statement
at the top
import java.Point.*;
public class Circle extends Point {
-