package implementation;
public abstract class Student {
String name; int standard;
abstract void getPercentage();
static void getTotalNoOfStudents() {}
public Student() {}
public Student(String name, int standard) {
this.name=name; this.standard=standard;
}
}
public class ScienceStudent extends Student {
int ScienceMarks;
public static int noOfStudents=0;
public ScienceStudent(String name, int standard, int ScienceMarks) {
super(name, standard);
this.ScienceMarks=ScienceMarks;
}
public void getPercentage() {
System.out.println(10000/ScienceMarks);
}
}
public class HistoryStudent extends Student {
int historyMarks;
public static int noOfStudents;
public HistoryStudent(String name, int standard, int historyMarks) {
super(name, standard);
this.historyMarks=historyMarks;
}
public void getPercentage() {
System.out.println(10000/historyMarks);
}
}
public class AllStudent {
public static void main(String[] args) {
ScienceStudent abhi = new ScienceStudent("Abhishek",2,95);
HistoryStudent raj = new HistoryStudent("Rajath",2,80);
abhi.getPercentage();
raj.getPercentage();
}
}
i'm getting that error in the "AllStudent" class that " implicit super constructor Student() is undefined for default constructor. Must define an explicit constructor . Searched diff ans, but nothing helped to understand and correct the problem. It also says that "the type AllStudent must implement the inherited abstract method Student.getPercentage(); Can some one solve this and explain m what I should do to correct this.