Make a class student. The student class has data members such a sroll number, name, branch. Create a class called exam that has data members roll number and six subject marks. Derive the result class from student and exam it has own data members such a total mark, and result. Write a Java program to model the relationships.
package studenttest;
class student{
private String sroll_number, name, branch;
}
class exam extends student{
private String roll_number;
private int marks[];
public void display(){
marks = new int[6];
}
}
class result extends exam{
public double totalMark;
public double results;
}
public class StudentTest {
public static void main(String[] args) {
}
}
Comments
Thank you so much.It is very helpful to me.
Leave a comment