0% found this document useful (0 votes)
13 views2 pages

Interface Admin

Uploaded by

Avirup Das
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views2 pages

Interface Admin

Uploaded by

Avirup Das
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

interface Admin {

String COLG_NAME = "ABC College";

void select_cr(int year, String section);

abstract class Faculty {

// Instance variables

String name;

String faculty_id;

// Constructor to initialize name and faculty_id

public Faculty(String name, String faculty_id) {

this.name = name;

this.faculty_id = faculty_id;

// Abstract method to teach

abstract void teach(int semester);

void display() {

System.out.println("Faculty Name: " + name);

System.out.println("Faculty ID: " + faculty_id);

class Hod extends Faculty implements Admin{

// Constructor to initialize name and faculty_id

public Hod(String name, String faculty_id) {

super(name, faculty_id);

}
public void select_cr(int year, String section) {

System.out.println("CR selected for Year: " + year + ", Section: " + section);

@Override

void teach(int semester) {

System.out.println(name + " is teaching Semester: " + semester);

public class useOfInterface {

public static void main(String[] args) {

Hod hod = new Hod("Dr. Smith", "F12345");

hod.display();

hod.teach(3);

hod.select_cr(2, "B");

System.out.println("College: " + Admin.COLG_NAME);

You might also like