-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
70 lines (49 loc) · 1.55 KB
/
Copy pathMain.java
File metadata and controls
70 lines (49 loc) · 1.55 KB
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
package com;
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
import java.util.Collections;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.Map;
import java.util.regex.Pattern;
public class Main {
private int i = 0;
static {
System.out.println("in static");
}
{
System.out.println("in block");
}
public Main() {
System.out.println("constructor");
}
private static Pattern p = Pattern.compile("\\w+\\.");
public static void main(String[] args) {
System.out.println("main");
new Main().i = 1;
Class<?> baseType = Bar.class;
System.out.println(baseType.isAssignableFrom(Home.class));
try {
Class<?> c = Class.forName("com.Bar");
Method[] methods = c.getMethods();
Constructor[] constructors = c.getConstructors();
for (Method m : methods) {
System.out.printf(m.toString());
System.out.println(p.matcher(m.toString()).replaceAll(""));
}
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
Hashtable<String, Integer> hashtable = new Hashtable<>();
HashMap<String, Integer> map = new HashMap<>();
Map<String, Integer> m = Collections.synchronizedMap(new HashMap());
char c = '】';
System.out.println(c);
byte b = (byte) c;
System.out.println(b);
c = (char) b;
System.out.println(c);
}
public class QueueBehavior {
}
}