Professional Documents
Culture Documents
Experiment No:-01: Title: Problem Statement
Experiment No:-01: Title: Problem Statement
Algorithm:
1. Start the Program
2. Create a SuperClass Teacher
3. Declare the Display Method
4. Create three more classes(Professor/Associate Professor/Assistant Professor)
and Extend the Parent class and declare display method
5. Call the main method and create object
6. Display the object
7. Stop the Program
Program:
class Teacher
{
public void print_Teacher()
{
System.out.println("Ms. Rita Roy");
}
}
class Professor extends Teacher
{
public void print_Professor()
{
System.out.println("Ms. Suhasini Shukla");
}
}
class Associate_Professor extends Teacher
{
public void print_Associate_Professor()
{
System.out.println("Ms. Veena Jagtap");
}
}
class Assistant_Professor extends Teacher
{
public void print_Assistant_Professor()
{
System.out.println("Ms. Maya Singh");
}
}
public class EXP_1
{
public static void main(String[] args)
{
Teacher t = new Teacher();
t.print_Teacher();
Professor p = new Professor();
p.print_Professor();
Associate_Professor ap = new Associate_Professor();
ap.print_Associate_Professor();
Assistant_Professor asp = new Assistant_Professor();
asp.print_Assistant_Professor();
}
}