Cannot find symbol in same package and directory

后端 未结 3 1043
遥遥无期
遥遥无期 2021-01-05 02:15

I have two classes, Offering and Course. They are both in the same package and the same directory.

Offering.java:

package assignment02;

public class         


        
3条回答
  •  离开以前
    2021-01-05 02:52

    You need to compile Course.java first—Offering.java depends on it because you referenced it. Also,

    public int getNumCredits() {
        return course.getNumCredits;
    }
    

    should be

    public int getNumCredits() {
        return course.getNumCredits();
    }
    

提交回复
热议问题