FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
OnJava8-Examples/generics/NotSelfBounded.java at master · CSapprenticeWT/OnJava8-Examples · GitHub
CSapprenticeWT
OnJava8-Examples
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
OnJava8-Examples
/
generics
/
NotSelfBounded.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
24 lines (20 loc) · 588 Bytes
Breadcrumbs
OnJava8-Examples
/
generics
/
NotSelfBounded.java
Copy path
File metadata and controls
24 lines (20 loc) · 588 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
// generics/NotSelfBounded.java
// (c)2021 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose.
// Visit http://OnJava8.com for more book information.
public
class
NotSelfBounded
<
T
> {
T
element
;
NotSelfBounded
<
T
>
set
(
T
arg
) {
element
=
arg
;
return
this
;
}
T
get
() {
return
element
; }
}
class
A2
extends
NotSelfBounded
<
A2
> {}
class
B2
extends
NotSelfBounded
<
A2
> {}
class
C2
extends
NotSelfBounded
<
C2
> {
C2
setAndGet
(
C2
arg
) {
set
(
arg
);
return
get
(); }
}
class
D2
{}
// Now this is OK:
class
E2
extends
NotSelfBounded
<
D2
> {}
Back
|
FazBrowse Home
|
New Git URL