我有一个对象的自定义类,如下所示:
public class StudentState implements Serializable {
private static final long serialVersionUID = -3001666080405760977L;
public CourseState CourseState;
public class CourseState implements Serializable {
private static final long serialVersionUID = -631172412478493444L;
public List<Lessonstates> lessonstates;
}
public class Lessonstates implements Serializable {
private static final long serialVersionUID = -5209770078710286360L;
public int state;
}
}
现在我想在我的代码中初始化 Lessonstates 以使用它。我已经这样做了,但它有一个错误:
CourseState state = test.new CourseState();
Lessonstates newLesson = state.new Lessonstates();
我也试过这个:
Lessonstates newLesson = new CourseState().new Lessonstates();
错误是 StudentState.CourseState.Lessonstates 无法解析为一个类型有没有人可以帮我解决它?