62,614
社区成员
发帖
与我相关
我的任务
分享
package pe201301;
abstract class Student{
protected String name;
protected int stuNo;
protected double GPA;
protected int grades;
public Student(int stuNo, String name, int grades){
this.stuNo = stuNo;
this.name = name;
this.grades = grades;
}
//abstract double getGPA();
double computeWg(){
return grades*100;
}
}
class ActStudent extends Student{
private int Apoints;
ActStudent(int stuNo, String name, int grades, int Apoints){
super(stuNo,name,grades);
this.Apoints = Apoints;
}
public double getGPA(){
return GPA = grades*100;
}
}
public class Java {
public static void main(String[] args) {
ActStudent a = new ActStudent(101,"zhang",89,10);
System.out.println(a.getGPA());
}
}