Tuesday, 10 September 2013

Java can't find symbol from .class in the same directory

Java can't find symbol from .class in the same directory

I have two files: MyStringLog.java (which extends ArrayStringLog) and
TestDriver.java in the same directory. Why doesn't TestDriver.java
recognize the MyStringLog constructor from the MyStringLog class? In
TestDriver.java I declare:
MyStringLog animals = new MyStringLog("animals");
This is supposed to construct a new MyStringLog object named animals, but
I get 2 errors when I compile, both, that MyStringLog symbol is not found.
ArrayStringLog.java: http://pastebin.com/Z624DRcm
MyStringLog.java:http://pastebin.com/zaH2S3yg
TestDriver.java:
public class TestDriver {
public static void main(String[] args) {
MyStringLog animals = new MyStringLog("animals");
animals.insert("dog");
}
}

No comments:

Post a Comment