FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
algorithms/src/test/java/ClassInitDemo.java at master · verifyCode/algorithms · GitHub
verifyCode
algorithms
Repository navigation
Code
Issues
Pull requests
2
(2)
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
algorithms
/
src
/
test
/
java
/
ClassInitDemo.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
56 lines (47 loc) · 1.32 KB
Breadcrumbs
algorithms
/
src
/
test
/
java
/
ClassInitDemo.java
Copy path
File metadata and controls
56 lines (47 loc) · 1.32 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
import
sun
.
misc
.
Unsafe
;
/**
* @author xjn
* @since 2020-03-02
*/
public
class
ClassInitDemo
{
final
String
result
;
private
static
final
char
value
[] =
new
char
[
10
];
private
static
ThreadLocal
threadLocal
;
public
ClassInitDemo
(
String
x
,
String
y
) {
this
.
result
=
add
(
x
,
y
);
}
public
String
add
(
String
x
,
String
y
) {
threadLocal
.
remove
();
return
x
+
y
;
}
static
class
SubClass
extends
ClassInitDemo
{
String
z
;
public
SubClass
(
String
x
,
String
y
,
String
z
) {
super
(
x
,
y
);
this
.
z
=
z
;
}
public
String
add
(
String
x
,
String
y
) {
return
super
.
add
(
x
,
y
) +
z
;
}
}
public
static
String
appendStr
(
String
s
) {
s
+=
"bbb"
;
System
.
out
.
println
(
s
);
return
s
;
}
public
static
Integer
test
(
Integer
a
) {
a
+=
1
;
return
a
;
}
public
static
void
main
(
String
[]
args
)
throws
Exception
{
// System.out.println(new SubClass("A", "B", "C").result);
// String s = new String("aaa");
// String ns = appendStr(s);
// System.out.println("s:" + s.toString());
Unsafe
unsafe
=
Unsafe
.
getUnsafe
();
Integer
a
=
1
;
Integer
test
=
test
(
a
);
System
.
out
.
println
(
"a:"
+
a
);
System
.
out
.
println
(
"test:"
+
test
);
}
}
Back
|
FazBrowse Home
|
New Git URL