-
Notifications
You must be signed in to change notification settings - Fork 0
/
UILTest.java
70 lines (55 loc) · 1.46 KB
/
UILTest.java
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import MazeSolver.Maze;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class UILTest {
static ArrayList<Integer> a = new ArrayList<>();
static int count = 0;
public static void dfs(int i) {
if(i >= a.size()) return;
++count;
dfs(i * 2 + 1);
dfs(i * 2 + 2);
}
public static void main(String[] args) {
for(int i = 0; i < 1000; ++i) a.add(i+1);
for(int i = 0; i < 1000; ++i)
dfs(i);
System.out.println(count);
// Pattern p = Pattern.compile("\\b") ;
// String s = "aafafa";
// System.out.println(Arrays.toString(s.split("a")));
// System.out.println(String.format("%(+10d", -1));
/*
doing short = short + int, won't compile, but short += int will
doing print on an object of type object, will still do the toString() of the actual object type
*/
// int[] k = new int[5];
// int[] y = k;
// k[1] = 2;
// System.out.println(Arrays.toString(k));
//
// B o = new B();
//
//
// System.out.println(o instanceof B);
// System.out.println(o.x);
/*
subclass methods
superclass vars (if subclass var doesnt exist -> compile error)
*/
}
}
class A {
int x = 5;
public void A() {
System.out.println("A");
}
}
class B extends A{
int x = 10;
public void A() {
System.out.println(super.x);
super.A();
}
}