- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDaY8_Override.java
More file actions
Latest commit
40 lines (37 loc) · 705 Bytes
/
Copy pathDaY8_Override.java
File metadata and controls
40 lines (37 loc) · 705 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
classTest
{
publicvoidm1()
{
System.out.println("m1.........");
}
publicvoidm2(intx)
{
System.out.println("int m2.....");
}
}
classTest1extendsTest
{
publicvoidm1()
{
System.out.println("m1.......override");
}
// public void m2(int x)
// {
// System.out.println("int m2........override");
// }
}
publicclassDaY8_Override
{
publicstaticvoidmain(String[] str)
{
// Test t1 = new Test();
// t1.m1();
// t1.m2(100);
// Test1 t1 = new Test1();
// t1.m1();
// t1.m2(100);
Testt1 = newTest1();
t1.m1();
t1.m2(100);
}
}