Interface and Inheritance
Interface and Inheritance
Scanner;
interface Exam{
void percent_cal();
}
class Student{
public static final int NUM = 5;
String name;
int roll_no;
int mark[] = new int[NUM];
void display(){
System.out.println("Register number of student : " + roll_no);
System.out.println("Name of the Student : " + name);
System.out.println("Marks of the Student : ");
for(int i=0; i<NUM; i++)
System.out.println("Mark " + (i+1) + " : " + mark[i]);
}
}
Percentage : 82.0