📄 callnum.java
字号:
package Entities;
/** This class contains a numeric description of a course section */
public class CallNum
{
/** a complete description of the course */
protected int courseNum;
protected int deptNum;
protected int sectionNum;
/** Return the course */
public int courseNum()
{
return courseNum;
}
/** Return the department the class belongs */
public int deptNum()
{
return deptNum;
}
/** Returnt the class section */
public int sectionNum()
{
return sectionNum;
}
/** Create a new call number from the arguments */
public CallNum(int dept, int cou, int sect)
{
deptNum = dept;
courseNum = cou;
sectionNum = sect;
}
/** Does other represent the same course as Current */
public boolean sameCourse(CallNum other)
{
return ((other.deptNum() == deptNum) &&
(other.courseNum() == courseNum) &&
(other.sectionNum() == sectionNum));
}
/** Return a string representation of the section name */
public String toString()
{
String result = "\nDepartment Number : " + deptNum;
result += "\nCourse Number : " + courseNum;
result += "\nSection Number : " + sectionNum;
return result;
}
} /* end of CallNum */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -