Good morning,
I have been working on a project for the last few weeks, and I cant seem to figure out what I am doing wrong. When I run the java files, it will not find the Displayable class. This is not the only file in the util package, and yet it is the only one it will not find. I am new to JAVA, and this is my first project.
I am also new to this site. I don't see where I can upload files. Here is what I have copied from DOS Shell for the error messages for each of the classes.
C:\Users\moga2\Desktop\Webucator\Project Directory>javac PrintReports.java
.\util\Displayable.java:3: error: class, interface, or enum expected
public abstract String display() {
^
PrintReports.java:7: error: cannot access Displayable
ArrayList<Displayable> classroomList = new ArrayList<>();
^
bad source file: .\util\Displayable.java
file does not contain class util.Displayable
Please remove or make sure it appears in the correct subdirectory of the sourcepath.
C:\Users\moga2\Desktop\Webucator\Project Directory\school>javac Classroom.java Classroom.java:2: error: package util does not exist
import util.Displayable;
^
Classroom.java:6: error: cannot find symbol
public class Classroom implements Displayable {
^
symbol: class Displayable
Classroom.java:9: error: cannot find symbol
private Displayable teacher;
^
symbol: class Displayable
location: class Classroom
Classroom.java:10: error: cannot find symbol
private ArrayList<Displayable> students;
^
symbol: class Displayable
location: class Classroom
Classroom.java:15: error: cannot find symbol
public Classroom(int roomNumber, Displayable teacher, ArrayList<Displayable> students) {
^
symbol: class Displayable
location: class Classroom
Classroom.java:15: error: cannot find symbol
public Classroom(int roomNumber, Displayable teacher, ArrayList<Displayable> students) {
^
symbol: class Displayable
location: class Classroom
Classroom.java:29: error: cannot find symbol
public Displayable getTeacher() {
^
symbol: class Displayable
location: class Classroom
Classroom.java:33: error: cannot find symbol
public void setTeacher(Displayable teacher) {
^
symbol: class Displayable
location: class Classroom
Classroom.java:37: error: cannot find symbol
public ArrayList<Displayable> getStudents() {
^
symbol: class Displayable
location: class Classroom
Classroom.java:41: error: cannot find symbol
public void setStudents(ArrayList<Displayable> students) {
^
symbol: class Displayable
location: class Classroom
Classroom.java:45: error: method does not override or implement a method from a supertype
@Override
^
Classroom.java:50: error: cannot find symbol
ArrayList<Displayable> studentList = this.getStudents();
^
symbol: class Displayable
location: class Classroom
12 errors
C:\Users\moga2\Desktop\Webucator\Project Directory\school>javac Student.java
Student.java:2: error: package util does not exist
import util.Displayable;
^
Student.java:4: error: cannot find symbol
public class Student extends Person implements Displayable {
^
symbol: class Person
Student.java:4: error: cannot find symbol
public class Student extends Person implements Displayable {
^
symbol: class Displayable
Student.java:13: error: cannot find symbol
this.setFirstName(firstName);
^
symbol: method setFirstName(String)
Student.java:14: error: cannot find symbol
this.setLastName(lastName);
^
symbol: method setLastName(String)
Student.java:35: error: method does not override or implement a method from a supertype
@Override
^
Student.java:37: error: cannot find symbol
return "Student ID: " + this.getStudentId() + " " + this.getFullName() + " Final Grade: " + this.getFinalGrade();
^
symbol: method getFullName()
7 errors
C:\Users\moga2\Desktop\Webucator\Project Directory\school>javac Teacher.java
Teacher.java:2: error: package util does not exist
import util.Displayable;
^
Teacher.java:4: error: cannot find symbol
public class Teacher extends Person implements Displayable {
^
symbol: class Person
Teacher.java:4: error: cannot find symbol
public class Teacher extends Person implements Displayable {
^
symbol: class Displayable
Teacher.java:11: error: cannot find symbol
this.setFirstName(firstName);
^
symbol: method setFirstName(String)
Teacher.java:12: error: cannot find symbol
this.setLastName(lastName);
^
symbol: method setLastName(String)
Teacher.java:21: error: method does not override or implement a method from a supertype
@Override
^
Teacher.java:23: error: cannot find symbol
return this.getFullName() + "teaches" + this.getSubject();
^
symbol: method getFullName()
7 errors
What I have tried:
I have checked the classpath, I have re-created the entire project, and re-installed all software just to be sure.