Skip to content

Commit 3a2bf96

Browse files
committed
Today I Learned Extends, PS J1927
1 parent e91564e commit 3a2bf96

3 files changed

Lines changed: 47 additions & 3 deletions

File tree

‎TIL/Extends.java‎

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
package TIL;
2+
3+
public class Extends {
4+
public static void main(String[] args) {
5+
Super s = new child();
6+
s.sayA();
7+
s.sayB();
8+
}
9+
}
10+
11+
class Super{
12+
public void sayA() {
13+
System.out.println("A");
14+
sayB();
15+
}
16+
17+
public void sayB(){
18+
System.out.println("B");
19+
this.sayB();
20+
21+
}
22+
}
23+
24+
class child extends Super{
25+
public void sayA(){
26+
super.sayB();
27+
System.out.println("a");
28+
29+
}
30+
31+
public void sayB(){
32+
System.out.println("b");
33+
}
34+
}

‎TIL/J1927.java‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,12 @@ public static void main(String[] args) throws IOException {
1717
}else System.out.println(pq.poll());
1818
}else pq.offer(value);
1919
}
20+
21+
// int a= A();
2022
}
23+
24+
// public int A(){
25+
// return 3;
26+
27+
// }
2128
}

‎TIL/hi.java‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
package TIL;
22

3-
import java.util.HashSet;
4-
import java.util.Set;
3+
import java.util.*;
54

65
public class hi {
76
public static void main(String[] args) {
8-
Set<Integer> set = new HashSet<>();
7+
List<Integer> list = new ArrayList<>();
8+
9+
10+
Collections.sort(list, (o1, o2)-> o2-o1);
11+
912
}
1013
}

0 commit comments

Comments
 (0)