FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
ThinkingInJava/reusingClasses/Exercise23.java at main · viktorvoltz/ThinkingInJava · GitHub
viktorvoltz
/
ThinkingInJava
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
ThinkingInJava
/
reusingClasses
/
Exercise23.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
40 lines (35 loc) · 899 Bytes
Breadcrumbs
ThinkingInJava
/
reusingClasses
/
Exercise23.java
Copy path
File metadata and controls
40 lines (35 loc) · 899 Bytes
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
class
One
{
static
int
one
=
printInit
(
"one.initiaalized"
);
static
int
printInit
(
String
s
){
System
.
out
.
println
(
s
);
return
1
;
}
}
class
Two
extends
One
{
static
int
two
=
printInit
(
"two.initialized"
);
Two
(){
System
.
out
.
println
(
"two constructor"
);
}
}
class
Three
{
static
int
n
=
printInit
(
"Three.initialized"
);
static
One
one
=
new
One
();
Three
(){
System
.
out
.
println
(
"Three construtor"
);
}
static
int
printInit
(
String
s
){
System
.
out
.
println
(
s
);
return
3
;
}
}
public
class
Exercise23
extends
Two
{
static
int
i
=
printInit
(
"Exercise23.initialized"
);
Exercise23
(){
System
.
out
.
println
(
"Exercise23 constructor"
);
}
public
static
void
main
(
String
[]
args
){
System
.
out
.
println
(
"main"
);
Exercise23
ex
=
new
Exercise23
();
System
.
out
.
println
(
Three
.
one
);
}
}
Back
|
FazBrowse Home
|
New Git URL