在Java语言中,下列关于类的继承的描述,正确的是( )。 (选择一项)
选择b
有时候自己找题很崩溃
所以我把这些做过的题全部放到了一起,希望能对你有所帮助吧
点我领答案
本学期期末学员共参加了3门课的考试,即Java,C,SQL,编写方法计算每位学员3门课的平均分。
class Student {
private double javaRecord;
private double cRecord;
private double sqlRecord;
public Student(double javaRecord, double cRecord, double sqlRecord) {
this.javaRecord = javaRecord;
this.cRecord = cRecord;
this.sqlRecord = sqlRecord;
}
public double getcRecord() {
return cRecord;
}
public double getJavaRecord() {
return javaRecord;
}
public double getSqlRecord() {
return sqlRecord;
}
}
public class StudentBiz {
public double getAvg(Student stu) {
return (stu.getJavaRecord()+stu.getcRecord()+stu.getSqlRecord())/3;
}
public static void main(String args[]) {
Student stu = new Student(100, 80, 50);
System.out.println("平均成绩是:"+new StudentBiz().getAvg(stu));
}
}