FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
algorithms/src/test/java/DynamicDispatch.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
/
DynamicDispatch.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
34 lines (29 loc) · 680 Bytes
Breadcrumbs
algorithms
/
src
/
test
/
java
/
DynamicDispatch.java
Copy path
File metadata and controls
34 lines (29 loc) · 680 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
/**
* @author xjn
* @since 2020-03-08
*/
public
class
DynamicDispatch
{
static
abstract
class
Human
{
protected
abstract
void
sayHello
();
}
static
class
Man
extends
Human
{
@
Override
protected
void
sayHello
() {
System
.
out
.
println
(
"Man"
);
}
}
static
class
Woman
extends
Human
{
@
Override
protected
void
sayHello
() {
System
.
out
.
println
(
"WoMan"
);
}
}
public
static
void
main
(
String
[]
args
) {
Human
man
=
new
Man
();
Human
woman
=
new
Woman
();
man
.
sayHello
();
woman
.
sayHello
();
man
=
new
Woman
();
man
.
sayHello
();
}
}
Back
|
FazBrowse Home
|
New Git URL