Hi Java Developers,
wondering if someone can point out why references to 'Student' (successfully compiled java class) in my ValidRecords.java source file don't seem to resolve at compile time?
It's important to say that ANY and ALL references to Student object from inside ValidRecords.java don't resolve... not just the one I've listed below. I'm a newbie to java doing something really stupid, but what??? Appreciate some help from an experienced Java developer.
Things I've tried:
- ensured compiled Student.class file is in same dir AND classpath is set correctly to the same dir (should be redundant but done).
- same error from Netbeans and also from command line using javac ValidRecords.java
- ensured that both classes are public and so are the appropriate methods
code:
// this is an except from ValidRecords.java where the compiler says
// (refer after the code for compiler error) ...
public boolean addStudent(Student s) {
// wrapper for the arraylist add method
boolean addOk = Boolean.FALSE;
if( s.isValidStudent() ) { // s.isValidStudent() bombs because it can't resolve Student s: the compiler is not 'seeing' Student as a class from inside this class???
this.list.add(s);
addOk = Boolean.TRUE;
}
return addOk;
}
COMPILER ERROR:
D:\ST152-Warwick\Student.java\AssignSource\src\Assignment\ValidRecords.java:57: cannot find symbol
symbol : method isValidStudent()
location: class java.lang.Object
if( s.isValidStudent()