-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTest.java
More file actions
30 lines (26 loc) · 865 Bytes
/
Copy pathTest.java
File metadata and controls
30 lines (26 loc) · 865 Bytes
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
/*------------------------------------------------------------------------------
* Oracle Certified Professional Java SE 8 Programmer Exam 1Z0-809
* A Comprehensive OCPJP 8 Certification Guide
* by SG Ganesh, Hari Kiran and Tushar Sharma
------------------------------------------------------------------------------*/
import java.io.*;
class LastError<T> {
private T lastError;
void setError(T t){
lastError = t;
System.out.println("LastError: setError");
}
}
class StrLastError<S extends CharSequence> extends LastError<String>{
public StrLastError(S s) {
}
void setError(S s){
System.out.println("StrLastError: setError");
}
}
class Test {
public static void main(String []args) {
StrLastError<String> err = new StrLastError<String>("Error");
err.setError("Last error");
}
}