-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTeacher.java
More file actions
31 lines (27 loc) · 760 Bytes
/
Copy pathTeacher.java
File metadata and controls
31 lines (27 loc) · 760 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
class Teacher
{
String designation = "Teacher";
String collegeName = "NIET";
void does()
{
System.out.println("The work of teacher is"+" "+ "Teaching");
}
}
class JavaTeacher extends Teacher
{
void does()
{
System.out.println("The work of teacher is"+" "+ "OOTS Teaching");
super.does();
}
String mainSubject = "Object Oriented Techniques Using Java";
public static void main(String args[])
{
JavaTeacher obj;//Reference
obj = new JavaTeacher();//Object
System.out.println("The College Name is"+" "+ obj.collegeName);
System.out.println("The Designation is"+" "+ obj.designation);
System.out.println("The Main Subject is"+" "+obj.mainSubject);
obj.does();
}
}