-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMyClass.java
More file actions
45 lines (42 loc) · 839 Bytes
/
Copy pathMyClass.java
File metadata and controls
45 lines (42 loc) · 839 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
class Super
{
public void methodA()
{
System.out.println("method of Class A");
}
}
class Test extends Super
{
public void methodB()
{
System.out.println("method of Class B");
}
}
class C extends Super
{
public void methodC()
{
System.out.println("method of Class C");
}
}
class D extends Super
{
public void methodD()
{
System.out.println("method of Class D");
}
}
class MyClass{
// main class
//itx not the part
public static void main(String args[])
{
Test obj1 = new Test(); // b class ka object bnaya hai
C obj2 = new C();// c class ka object bnaya hai ,, to call method of c
D obj3 = new D(); // d class ka object bnaya hai
obj1.methodA();
obj1.methodA();
obj2.methodA();
obj3.methodA();
}
}