SlideShare a Scribd company logo




Acroquest Technology Co., Ltd.

Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
2
Java 

Chapter 7 

Chapter 8 

Chapter 9 

Chapter 12 

Acroquest Technology 

- 2017 3 

2Twitter: @omochiya
-
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
3




Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
4








Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
1.Introduction
2.Java 1.4 -> 5.0
3.Java 5.0 -> 7
4.Java 7 -> 8
5.Java 8 -> 9
6.Java 9 -> Future
5
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3


6
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
7
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
8
CSV File
2017-09-25,100,123456,Acroquest,
2017-10-02,100,-28980, ,
2017-10-03,100,-17712, ,
2017-10-20,100,3000000,gihyo,
2017-10-25,100,200000,Acroquest,


, , , ,
etc
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
9
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
10
List read(String fileName) {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
List list = new ArrayList();
BufferedReader reader = null;
try {
reader = new BufferedReader(new InputStreamReader(new FileInputStream(fileName), "UTF-8"));
String line;
while ((line = reader.readLine()) != null) {
String[] s = line.split(",");
Transaction tx = new Transaction();
tx.date = df.parse(s[0]);
tx.accountId = s[1];
tx.amount = Integer.valueOf(s[2]);
tx.name = s[3];
tx.note = s[4];
list.add(tx);
}
} catch (ParseException e) {
throw new RuntimeException("failed to parse date", e);
} catch (IOException e) {
throw new RuntimeException("failed to read file: " + fileName, e);
} finally {
try {
if (reader != null) {
reader.close();
}
} catch (IOException e) {
// ignore
}
}
return list;
}
CSV
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
1/3
11
List read(String fileName) {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
List list = new ArrayList();
BufferedReader reader = null;
try {
reader = new BufferedReader(new InputStreamReader(

new FileInputStream(fileName), "UTF-8"));
CSV
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
2/3
12
String line;
while ((line = reader.readLine()) != null) {
String[] s = line.split(",");
Transaction tx = new Transaction();
tx.date = df.parse(s[0]);
tx.accountId = s[1];
tx.amount = Integer.valueOf(s[2]);
tx.name = s[3];
tx.note = s[4];
list.add(tx);

}
CSV
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
3/3
13
} catch (ParseException e) {
throw new RuntimeException("failed to parse date", e);
} catch (IOException e) {
throw new RuntimeException("failed to read file: " + fileName, e);
} finally {
try {
if (reader != null) {
reader.close();
}
} catch (IOException e) {
// ignore
}
}
return list;
}
finally close
CSV
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
Transaction
14
class Transaction {
Date date;
String accountId;
Integer amount;
String name;
String note;
public Transaction() {
}
public Transaction(Date date, String accountId, Integer amount, String name, String note) {
this.date = date;
this.accountId = accountId;
this.amount = amount;
this.name = name;
this.note = note;
}
public String toString() {
return date + " " + accountId + " " + amount + " " + name + " " + note;
}
}
CSV
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
Transaction 1/2
15
class Transaction {
Date date;
String accountId;
Integer amount;
String name;
String note;
public Transaction() {
}
CSV
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
Transaction 2/2
16
public Transaction(Date date, String accountId, Integer amount, 

String name, String note) {
this.date = date;
this.accountId = accountId;
this.amount = amount;
this.name = name;
this.note = note;
}
public String toString() {
return date + " " + accountId + " " + amount + " " + name + " " + note;
}
}
CSV
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
-
17
List list = read(fileName);
int sum = 0;
for (int i = 0; i < list.size(); i++) {
Transaction tx = (Transaction) list.get(i);
sum += tx.amount;
}
System.out.println(sum);
CSV
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
- 6
18
List list = read(fileName);
for (int i = 0; i < list.size(); i++) {
Transaction tx = (Transaction) list.get(i);
Calendar cal = Calendar.getInstance();
cal.setTime(tx.date);
if (cal.get(Calendar.MONTH) == 5) {
System.out.println(tx);
}
}
0
CSV
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3


19
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
20
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3


21
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
1/3
22
List read(String fileName) {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
List list = new ArrayList();
BufferedReader reader = null;
try {
reader = new BufferedReader(new InputStreamReader(

new FileInputStream(fileName), "UTF-8"));
CSV
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
1/3
23
List<Transaction> read(String fileName) {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
List<Transaction> list = new ArrayList<Transaction>();
BufferedReader reader = null;
try {
reader = new BufferedReader(new InputStreamReader(

new FileInputStream(fileName), "UTF-8"));
CSV
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
1/3
24
List<Transaction> read(String fileName) {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
List<Transaction> list = new ArrayList<Transaction>();
BufferedReader reader = null;
try {
reader = new BufferedReader(new InputStreamReader(

new FileInputStream(fileName), "UTF-8"));
Generics 

→ 

→
CSV
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
-
25
List list = read(fileName);
int sum = 0;
for (int i = 0; i < list.size(); i++) {
Transaction tx = (Transaction) list.get(i);
sum += tx.amount;
}
System.out.println(sum);
CSV
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
-
26
List<Transaction> list = read(fileName);
int sum = 0;
for (Transaction tx : list) {
sum += tx.amount;
}
System.out.println(sum);
CSV
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
-
27
List<Transaction> list = read(fileName);
int sum = 0;
for (Transaction tx : list) {
sum += tx.amount;
}
System.out.println(sum);
CSV
for 

→
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3


28
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
Transaction 2/2
29
public Transaction(Date date, String accountId, Integer amount, 

String name, String note) {
this.date = date;
this.accountId = accountId;
this.amount = amount;
this.name = name;
this.note = note;
}
public String toString() {
return date + " " + accountId + " " + amount + " " + name + " " + note;
}
}
CSV
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
Transaction 2/2
30
public Transaction(Date date, String accountId, Integer amount, 

String name, String note) {
this.date = date;
this.accountId = accountId;
this.amount = amount;
this.name = name;
this.note = note;
}
@Override
public String toString() {
return date + " " + accountId + " " + amount + " " + name + " " + note;
}
}
CSV
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
Transaction 2/2
31
public Transaction(Date date, String accountId, Integer amount, 

String name, String note) {
this.date = date;
this.accountId = accountId;
this.amount = amount;
this.name = name;
this.note = note;
}
@Override
public String toString() {
return date + " " + accountId + " " + amount + " " + name + " " + note;
}
}


→ Override
CSV
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
32
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
33
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3


34
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3


35
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
1/3
36
List<Transaction> read(String fileName) {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
List<Transaction> list = new ArrayList<Transaction>();
BufferedReader reader = null;
try {
reader = new BufferedReader(new InputStreamReader(

new FileInputStream(fileName), "UTF-8"));
CSV
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
1/3
37
List<Transaction> read(String fileName) {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
List<Transaction> list = new ArrayList<>();
try (BufferedReader reader =
Files.newBufferedReader(Paths.get(fileName),
StandardCharsets.UTF_8)) {
CSV
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
1/3
38
List<Transaction> read(String fileName) {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
List<Transaction> list = new ArrayList<>();
try (BufferedReader reader =
Files.newBufferedReader(Paths.get(fileName),
StandardCharsets.UTF_8)) {
CSV
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
1/3
39
List<Transaction> read(String fileName) {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
List<Transaction> list = new ArrayList<>();
try (BufferedReader reader =
Files.newBufferedReader(Paths.get(fileName),
StandardCharsets.UTF_8)) {
try-with-resoureces 

try ( ) close 

→ 

→ 

CSV
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3


40
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
1/3
41
List<Transaction> read(String fileName) {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
List<Transaction> list = new ArrayList<>();
try (BufferedReader reader =
Files.newBufferedReader(Paths.get(fileName),
StandardCharsets.UTF_8)) {
Files nio2
CSV
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
1/3
42
List<Transaction> read(String fileName) {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
List<Transaction> list = new ArrayList<>();
try (BufferedReader reader =
Files.newBufferedReader(Paths.get(fileName),
StandardCharsets.UTF_8)) {
String Charset 

StandardCharsets 

→
CSV
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
3/3
43
} catch (ParseException e) {
throw new RuntimeException("failed to parse date", e);
} catch (IOException e) {
throw new RuntimeException("failed to read file: " + fileName, e);
} finally {
try {
if (reader != null) {
reader.close();
}
} catch (IOException e) {
// ignore
}
}
return list;
}
CSV
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
3/3
44
} catch (ParseException | IOException e) {
throw new RuntimeException("failed to parse date or read file”, e);
}
return list;
}
catch 

CSV
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3


45
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
46
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
47
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3


48
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3




49
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3


50
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
Transaction toString
51
class Transaction {
Date date;
String accountId;
Integer amount;
String name;
String note;
public Transaction() {
}
public Transaction(Date date, String accountId, Integer amount, String name, String note)
{
this.date = date;
this.accountId = accountId;
this.amount = amount;
this.name = name;
this.note = note;
}
CSV
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
Transaction toString
52
class Transaction {
LocalDate date;
String accountId;
Integer amount;
String name;
String note;
public Transaction() {
}
public Transaction(LocalDate date, String accountId, Integer amount, String name, String
note) {
this.date = date;
this.accountId = accountId;
this.amount = amount;
this.name = name;
this.note = note;
}
CSV
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
Transaction toString
53
class Transaction {
LocalDate date;
String accountId;
Integer amount;
String name;
String note;
public Transaction() {
}
public Transaction(LocalDate date, String accountId, Integer amount, String name, String
note) {
this.date = date;
this.accountId = accountId;
this.amount = amount;
this.name = name;
this.note = note;
}
Date and Time API

→LocalDate 

LocalDateTime LocalTime 

OffsetDateTime ZonedDateTime 

CSV
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3








54
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
55
List<Transaction> read(String fileName) {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
List<Transaction> list = new ArrayList<>();
try (BufferedReader reader = Files.newBufferedReader(Paths.get(fileName),
StandardCharsets.UTF_8)) {
String line;
while ((line = reader.readLine()) != null) {
String[] s = line.split(",");
Transaction tx = new Transaction();
tx.date = df.parse(s[0]);
tx.accountId = s[1];
tx.amount = Integer.valueOf(s[2]);
tx.name = s[3];
tx.note = s[4];
list.add(tx);

}
CSV
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
56
List<Transaction> read(String fileName) {
// SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
List<Transaction> list = new ArrayList<>();
try (BufferedReader reader = Files.newBufferedReader(Paths.get(fileName))) {
String line;
while ((line = reader.readLine()) != null) {
String[] s = line.split(",");
Transaction tx = new Transaction();
tx.date = LocalDate.parse(s[0]);
tx.accountId = s[1];
tx.amount = Integer.valueOf(s[2]);
tx.name = s[3];
tx.note = s[4];
list.add(tx);

}
CSV
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
57
List<Transaction> read(String fileName) {
// SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
List<Transaction> list = new ArrayList<>();
try (BufferedReader reader = Files.newBufferedReader(Paths.get(fileName))) {
String line;
while ((line = reader.readLine()) != null) {
String[] s = line.split(",");
Transaction tx = new Transaction();
tx.date = LocalDate.parse(s[0]);
tx.accountId = s[1];
tx.amount = Integer.valueOf(s[2]);
tx.name = s[3];
tx.note = s[4];
list.add(tx);

}
UTF-8 Charset


ISO 8601 

CSV
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3


58
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
- 6
59
List<Transaction> list = read(fileName);
for (Transaction tx : list) {
Calendar cal = Calendar.getInstance();
cal.setTime(tx.date);
if (cal.get(Calendar.MONTH) == 5) {
System.out.println(tx);
}
}
CSV
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
- 6
60
List<Transaction> list = read(fileName);
for (Transaction tx : list) {
if (tx.date.getMonth() == Month.JUNE) {
System.out.println(tx);
}
}
CSV
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
- 6
61
List<Transaction> list = read(fileName);
for (Transaction tx : list) {
if (tx.date.getMonth() == Month.JUNE) {
System.out.println(tx);
}
}
enum 

enum 

→ 0 

CSV
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3




62
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
63
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3




64
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3


65
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
66
List<Transaction> list = new ArrayList<>();
try (BufferedReader reader = Files.newBufferedReader(Paths.get(fileName))) {
String line;
while ((line = reader.readLine()) != null) {
String[] s = line.split(",");
Transaction tx = new Transaction();
tx.date = LocalDate.parse(s[0]);
tx.accountId = s[1];
tx.amount = Integer.valueOf(s[2]);
tx.name = s[3];
tx.note = s[4];
list.add(tx);

}
} catch (ParseException | IOException e) {
throw new RuntimeException("failed to parse date or read file”, e);
}
return list;
CSV
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
67
try (Stream<String> stream = Files.lines(Paths.get(fileName))) {
return stream
.map(line -> {
String[] s = line.split(",");
Transaction tx = new Transaction();
tx.date = LocalDate.parse(s[0]);
tx.accountId = s[1];
tx.amount = Integer.valueOf(s[2]);
tx.name = s[3];
tx.note = s[4];
return tx;
})
.collect(Collectors.toList());
} catch (ParseException | IOException e) {
throw new UncheckedIOException("failed to read file", e);
}
CSV
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
68
try (Stream<String> stream = Files.lines(Paths.get(fileName))) {
return stream
.map(line -> {
String[] s = line.split(",");
Transaction tx = new Transaction();
tx.date = LocalDate.parse(s[0]);
tx.accountId = s[1];
tx.amount = Integer.valueOf(s[2]);
tx.name = s[3];
tx.note = s[4];
return tx;
})
.collect(Collectors.toList());
} catch (ParseException | IOException e) {
throw new UncheckedIOException("failed to read file", e);
}


Stream 

List
CSV


String Transaction
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
69
try (Stream<String> stream = Files.lines(Paths.get(fileName))) {
return stream
.map(line -> {
String[] s = line.split(",");
Transaction tx = new Transaction();
tx.date = LocalDate.parse(s[0]);
tx.accountId = s[1];
tx.amount = Integer.valueOf(s[2]);
tx.name = s[3];
tx.note = s[4];
return tx;
})
.collect(Collectors.toList());
} catch (ParseException | IOException e) {
throw new UncheckedIOException("failed to read file", e);
}
Lambda
CSV
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
1
70
//
List<Transaction> list = read(fileName);
//
for (Transaction tx : list) {
System.out.println(tx);
}
//
int sum = 0;
for (Transaction tx : list) {
sum += tx.amount;
}
System.out.println(sum);
CSV
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
1
71
//
read(fileName).stream()
.forEach(System.out::println);
//
int sum = read(fileName).stream()
.mapToInt(tx -> tx.amount)
.sum();
System.out.println(sum);
CSV
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
1
72
//
read(fileName).stream()
.forEach(System.out::println);
//
int sum = read(fileName).stream()
.mapToInt(tx -> tx.amount)
.sum();
System.out.println(sum);
int
CSV


Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
1
73
//
read(fileName).stream()
.forEach(System.out::println);
//
int sum = read(fileName).stream()
.mapToInt(tx -> tx.amount)
.sum();
System.out.println(sum);
Lambda
CSV
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
2
74
// 6 

for (Transaction tx : list) {
if (tx.date.getMonth() == Month.JUNE) {
System.out.println(tx);
}
}
CSV
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
2
75
// 6
read(fileName).stream()
.filter(tx -> tx.date.getMonth() == Month.JUNE)
.forEach(System.out::println);
CSV
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
2
76
// 6
read(fileName).stream()
.filter(tx -> tx.date.getMonth() == Month.JUNE)
.forEach(System.out::println);
6
filter
CSV
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
2
77
// 6
read(fileName).stream()
.filter(tx -> tx.date.getMonth() == Month.JUNE)
.forEach(System.out::println);
Lambda
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3




78
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3




79
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3




80
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3


81
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3


82
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
83
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3






84
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3




85
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3




86
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3








87
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3




88
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3






89
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
90
try (Stream<String> stream = Files.lines(Paths.get(fileName))) {
return stream
.map(line -> {
String[] s = line.split(",");
Transaction tx = new Transaction();
tx.date = LocalDate.parse(s[0]);
tx.accountId = s[1];
tx.amount = Integer.valueOf(s[2]);
tx.name = s[3];
tx.note = s[4];
return tx;
})
.collect(Collectors.toList());
} catch (ParseException | IOException e) {
throw new UncheckedIOException("failed to read file", e);
}


String Transaction
List
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
1
91
//
read(fileName).stream()
.forEach(System.out::println);
//
int sum = read(fileName).stream()
.mapToInt(tx -> tx.amount)
.sum();
System.out.println(sum);


int
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
2
92
// 6
read(fileName).stream()
.filter(tx -> tx.date.getMonth() == Month.JUNE)
.forEach(System.out::println);
6
filter
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3






93
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3






94
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3








95
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3








96
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
97
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
98
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3




99
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3






100
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3








101
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
JShell
102
//
jshell> List<Integer> intList = List.of(1, 2, 3);
intList ==> [1, 2, 3]
jshell> List<String> strList = List.of("aaa,", "bbb", “ccc");
strList ==> [aaa,, bbb, ccc]
jshell> intList.add(4);
| java.lang.UnsupportedOperationException thrown:
| at ImmutableCollections.uoe (ImmutableCollections.java:71)
( )
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
JShell
103
//
jshell> Map<Integer, String> map = 

Map.of(1, "aaa", 2, "bbb", 3, “ccc");
map ==> {1=aaa, 2=bbb, 3=ccc}
jshell> map.put(4, "ddd");
| java.lang.UnsupportedOperationException thrown:
| at ImmutableCollections.uoe (ImmutableCollections.java:71)
( )
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
104
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
105
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3


106
//
var str = “Hello”;
final var MAXIMUM = 100L;
// NG
var array = {1, 2, 3};
var list = new ArrayList<>();
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3
107
Copyright © Acroquest Technology Co., Ltd. All rights reserved.
#ccc_g3








108
Ad

More Related Content

What's hot (20)

Антон Нонко, Классические строки в C++
Антон Нонко, Классические строки в C++Антон Нонко, Классические строки в C++
Антон Нонко, Классические строки в C++
Sergey Platonov
 
Pattern Matching in Java 14
Pattern Matching in Java 14Pattern Matching in Java 14
Pattern Matching in Java 14
GlobalLogic Ukraine
 
JVM Mechanics
JVM MechanicsJVM Mechanics
JVM Mechanics
Doug Hawkins
 
Concurrency Concepts in Java
Concurrency Concepts in JavaConcurrency Concepts in Java
Concurrency Concepts in Java
Doug Hawkins
 
Down to Stack Traces, up from Heap Dumps
Down to Stack Traces, up from Heap DumpsDown to Stack Traces, up from Heap Dumps
Down to Stack Traces, up from Heap Dumps
Andrei Pangin
 
Bridge TensorFlow to run on Intel nGraph backends (v0.4)
Bridge TensorFlow to run on Intel nGraph backends (v0.4)Bridge TensorFlow to run on Intel nGraph backends (v0.4)
Bridge TensorFlow to run on Intel nGraph backends (v0.4)
Mr. Vengineer
 
Virtual machine and javascript engine
Virtual machine and javascript engineVirtual machine and javascript engine
Virtual machine and javascript engine
Duoyi Wu
 
Jdk(java) 7 - 6 기타기능
Jdk(java) 7 - 6 기타기능Jdk(java) 7 - 6 기타기능
Jdk(java) 7 - 6 기타기능
knight1128
 
The Art of JVM Profiling
The Art of JVM ProfilingThe Art of JVM Profiling
The Art of JVM Profiling
Andrei Pangin
 
Clojure for Java developers - Stockholm
Clojure for Java developers - StockholmClojure for Java developers - Stockholm
Clojure for Java developers - Stockholm
Jan Kronquist
 
Functional Reactive Programming / Compositional Event Systems
Functional Reactive Programming / Compositional Event SystemsFunctional Reactive Programming / Compositional Event Systems
Functional Reactive Programming / Compositional Event Systems
Leonardo Borges
 
Bridge TensorFlow to run on Intel nGraph backends (v0.5)
Bridge TensorFlow to run on Intel nGraph backends (v0.5)Bridge TensorFlow to run on Intel nGraph backends (v0.5)
Bridge TensorFlow to run on Intel nGraph backends (v0.5)
Mr. Vengineer
 
devday2012
devday2012devday2012
devday2012
Juan Lopes
 
Java Performance Puzzlers
Java Performance PuzzlersJava Performance Puzzlers
Java Performance Puzzlers
Doug Hawkins
 
JEEConf 2017 - Having fun with Javassist
JEEConf 2017 - Having fun with JavassistJEEConf 2017 - Having fun with Javassist
JEEConf 2017 - Having fun with Javassist
Anton Arhipov
 
What can be done with Java, but should better be done with Erlang (@pavlobaron)
What can be done with Java, but should better be done with Erlang (@pavlobaron)What can be done with Java, but should better be done with Erlang (@pavlobaron)
What can be done with Java, but should better be done with Erlang (@pavlobaron)
Pavlo Baron
 
Everything you wanted to know about Stack Traces and Heap Dumps
Everything you wanted to know about Stack Traces and Heap DumpsEverything you wanted to know about Stack Traces and Heap Dumps
Everything you wanted to know about Stack Traces and Heap Dumps
Andrei Pangin
 
JVM Mechanics: Understanding the JIT's Tricks
JVM Mechanics: Understanding the JIT's TricksJVM Mechanics: Understanding the JIT's Tricks
JVM Mechanics: Understanding the JIT's Tricks
Doug Hawkins
 
JEEConf 2017 - The hitchhiker’s guide to Java class reloading
JEEConf 2017 - The hitchhiker’s guide to Java class reloadingJEEConf 2017 - The hitchhiker’s guide to Java class reloading
JEEConf 2017 - The hitchhiker’s guide to Java class reloading
Anton Arhipov
 
Know yourengines velocity2011
Know yourengines velocity2011Know yourengines velocity2011
Know yourengines velocity2011
Demis Bellot
 
Антон Нонко, Классические строки в C++
Антон Нонко, Классические строки в C++Антон Нонко, Классические строки в C++
Антон Нонко, Классические строки в C++
Sergey Platonov
 
Concurrency Concepts in Java
Concurrency Concepts in JavaConcurrency Concepts in Java
Concurrency Concepts in Java
Doug Hawkins
 
Down to Stack Traces, up from Heap Dumps
Down to Stack Traces, up from Heap DumpsDown to Stack Traces, up from Heap Dumps
Down to Stack Traces, up from Heap Dumps
Andrei Pangin
 
Bridge TensorFlow to run on Intel nGraph backends (v0.4)
Bridge TensorFlow to run on Intel nGraph backends (v0.4)Bridge TensorFlow to run on Intel nGraph backends (v0.4)
Bridge TensorFlow to run on Intel nGraph backends (v0.4)
Mr. Vengineer
 
Virtual machine and javascript engine
Virtual machine and javascript engineVirtual machine and javascript engine
Virtual machine and javascript engine
Duoyi Wu
 
Jdk(java) 7 - 6 기타기능
Jdk(java) 7 - 6 기타기능Jdk(java) 7 - 6 기타기능
Jdk(java) 7 - 6 기타기능
knight1128
 
The Art of JVM Profiling
The Art of JVM ProfilingThe Art of JVM Profiling
The Art of JVM Profiling
Andrei Pangin
 
Clojure for Java developers - Stockholm
Clojure for Java developers - StockholmClojure for Java developers - Stockholm
Clojure for Java developers - Stockholm
Jan Kronquist
 
Functional Reactive Programming / Compositional Event Systems
Functional Reactive Programming / Compositional Event SystemsFunctional Reactive Programming / Compositional Event Systems
Functional Reactive Programming / Compositional Event Systems
Leonardo Borges
 
Bridge TensorFlow to run on Intel nGraph backends (v0.5)
Bridge TensorFlow to run on Intel nGraph backends (v0.5)Bridge TensorFlow to run on Intel nGraph backends (v0.5)
Bridge TensorFlow to run on Intel nGraph backends (v0.5)
Mr. Vengineer
 
Java Performance Puzzlers
Java Performance PuzzlersJava Performance Puzzlers
Java Performance Puzzlers
Doug Hawkins
 
JEEConf 2017 - Having fun with Javassist
JEEConf 2017 - Having fun with JavassistJEEConf 2017 - Having fun with Javassist
JEEConf 2017 - Having fun with Javassist
Anton Arhipov
 
What can be done with Java, but should better be done with Erlang (@pavlobaron)
What can be done with Java, but should better be done with Erlang (@pavlobaron)What can be done with Java, but should better be done with Erlang (@pavlobaron)
What can be done with Java, but should better be done with Erlang (@pavlobaron)
Pavlo Baron
 
Everything you wanted to know about Stack Traces and Heap Dumps
Everything you wanted to know about Stack Traces and Heap DumpsEverything you wanted to know about Stack Traces and Heap Dumps
Everything you wanted to know about Stack Traces and Heap Dumps
Andrei Pangin
 
JVM Mechanics: Understanding the JIT's Tricks
JVM Mechanics: Understanding the JIT's TricksJVM Mechanics: Understanding the JIT's Tricks
JVM Mechanics: Understanding the JIT's Tricks
Doug Hawkins
 
JEEConf 2017 - The hitchhiker’s guide to Java class reloading
JEEConf 2017 - The hitchhiker’s guide to Java class reloadingJEEConf 2017 - The hitchhiker’s guide to Java class reloading
JEEConf 2017 - The hitchhiker’s guide to Java class reloading
Anton Arhipov
 
Know yourengines velocity2011
Know yourengines velocity2011Know yourengines velocity2011
Know yourengines velocity2011
Demis Bellot
 

Viewers also liked (20)

Java SE 9の紹介: モジュール・システムを中心に
Java SE 9の紹介: モジュール・システムを中心にJava SE 9の紹介: モジュール・システムを中心に
Java SE 9の紹介: モジュール・システムを中心に
Taku Miyakawa
 
JJUG初心者のためのJava/JJUG講座
JJUG初心者のためのJava/JJUG講座JJUG初心者のためのJava/JJUG講座
JJUG初心者のためのJava/JJUG講座
Yusuke Suzuki
 
ユニットテストのアサーション 流れるようなインターフェースのAssertJを添えて 入門者仕立て
ユニットテストのアサーション 流れるようなインターフェースのAssertJを添えて 入門者仕立てユニットテストのアサーション 流れるようなインターフェースのAssertJを添えて 入門者仕立て
ユニットテストのアサーション 流れるようなインターフェースのAssertJを添えて 入門者仕立て
Ryosuke Uchitate
 
劇的改善 Ci4時間から5分へ〜私がやった10のこと〜
劇的改善 Ci4時間から5分へ〜私がやった10のこと〜劇的改善 Ci4時間から5分へ〜私がやった10のこと〜
劇的改善 Ci4時間から5分へ〜私がやった10のこと〜
aha_oretama
 
JVM上で動くPython処理系実装のススメ
JVM上で動くPython処理系実装のススメJVM上で動くPython処理系実装のススメ
JVM上で動くPython処理系実装のススメ
Yoshiaki Shibutani
 
Dockerで始める Java EE アプリケーション開発 for JJUG CCC 2017
Dockerで始める Java EE アプリケーション開発 for JJUG CCC 2017Dockerで始める Java EE アプリケーション開発 for JJUG CCC 2017
Dockerで始める Java EE アプリケーション開発 for JJUG CCC 2017
Kohei Saito
 
JEP280: Java 9 で文字列結合の処理が変わるぞ!準備はいいか!? #jjug_ccc
JEP280: Java 9 で文字列結合の処理が変わるぞ!準備はいいか!? #jjug_cccJEP280: Java 9 で文字列結合の処理が変わるぞ!準備はいいか!? #jjug_ccc
JEP280: Java 9 で文字列結合の処理が変わるぞ!準備はいいか!? #jjug_ccc
YujiSoftware
 
Business Process Modeling in Goldman Sachs @ JJUG CCC Fall 2017
Business Process Modeling in Goldman Sachs @ JJUG CCC Fall 2017Business Process Modeling in Goldman Sachs @ JJUG CCC Fall 2017
Business Process Modeling in Goldman Sachs @ JJUG CCC Fall 2017
tty fky
 
サーバサイド Kotlin
サーバサイド Kotlinサーバサイド Kotlin
サーバサイド Kotlin
Hiroki Ohtani
 
Selenide or Geb 〜あなたはその時どちらを使う〜
Selenide or Geb 〜あなたはその時どちらを使う〜Selenide or Geb 〜あなたはその時どちらを使う〜
Selenide or Geb 〜あなたはその時どちらを使う〜
Youtarou TAKAHASHI
 
Another compilation method in java - AOT (Ahead of Time) compilation
Another compilation method in java - AOT (Ahead of Time) compilationAnother compilation method in java - AOT (Ahead of Time) compilation
Another compilation method in java - AOT (Ahead of Time) compilation
Logico
 
サンプルアプリケーションで学ぶApache Cassandraを使ったJavaアプリケーションの作り方
サンプルアプリケーションで学ぶApache Cassandraを使ったJavaアプリケーションの作り方サンプルアプリケーションで学ぶApache Cassandraを使ったJavaアプリケーションの作り方
サンプルアプリケーションで学ぶApache Cassandraを使ったJavaアプリケーションの作り方
Yuki Morishita
 
Javaアプリケーションの モダナイゼーションアプローチ
Javaアプリケーションの モダナイゼーションアプローチJavaアプリケーションの モダナイゼーションアプローチ
Javaアプリケーションの モダナイゼーションアプローチ
CData Software Japan
 
Open Liberty: オープンソースになったWebSphere Liberty
Open Liberty: オープンソースになったWebSphere LibertyOpen Liberty: オープンソースになったWebSphere Liberty
Open Liberty: オープンソースになったWebSphere Liberty
Takakiyo Tanaka
 
将来 自分で サービスを持ちたいエンジニアの葛藤
将来 自分で サービスを持ちたいエンジニアの葛藤 将来 自分で サービスを持ちたいエンジニアの葛藤
将来 自分で サービスを持ちたいエンジニアの葛藤
Yoshio Kajikuri
 
高速なソートアルゴリズムを書こう!!
高速なソートアルゴリズムを書こう!!高速なソートアルゴリズムを書こう!!
高速なソートアルゴリズムを書こう!!
masakazu matsubara
 
マルチクラウドデータ連携Javaアプリケーションの作り方
マルチクラウドデータ連携Javaアプリケーションの作り方マルチクラウドデータ連携Javaアプリケーションの作り方
マルチクラウドデータ連携Javaアプリケーションの作り方
CData Software Japan
 
Polyglot on the JVM with Graal (English)
Polyglot on the JVM with Graal (English)Polyglot on the JVM with Graal (English)
Polyglot on the JVM with Graal (English)
Logico
 
DDD x CQRS 更新系と参照系で異なるORMを併用して上手くいった話
DDD x CQRS   更新系と参照系で異なるORMを併用して上手くいった話DDD x CQRS   更新系と参照系で異なるORMを併用して上手くいった話
DDD x CQRS 更新系と参照系で異なるORMを併用して上手くいった話
Koichiro Matsuoka
 
AI and Machine Learning Demystified by Carol Smith at Midwest UX 2017
AI and Machine Learning Demystified by Carol Smith at Midwest UX 2017AI and Machine Learning Demystified by Carol Smith at Midwest UX 2017
AI and Machine Learning Demystified by Carol Smith at Midwest UX 2017
Carol Smith
 
Java SE 9の紹介: モジュール・システムを中心に
Java SE 9の紹介: モジュール・システムを中心にJava SE 9の紹介: モジュール・システムを中心に
Java SE 9の紹介: モジュール・システムを中心に
Taku Miyakawa
 
JJUG初心者のためのJava/JJUG講座
JJUG初心者のためのJava/JJUG講座JJUG初心者のためのJava/JJUG講座
JJUG初心者のためのJava/JJUG講座
Yusuke Suzuki
 
ユニットテストのアサーション 流れるようなインターフェースのAssertJを添えて 入門者仕立て
ユニットテストのアサーション 流れるようなインターフェースのAssertJを添えて 入門者仕立てユニットテストのアサーション 流れるようなインターフェースのAssertJを添えて 入門者仕立て
ユニットテストのアサーション 流れるようなインターフェースのAssertJを添えて 入門者仕立て
Ryosuke Uchitate
 
劇的改善 Ci4時間から5分へ〜私がやった10のこと〜
劇的改善 Ci4時間から5分へ〜私がやった10のこと〜劇的改善 Ci4時間から5分へ〜私がやった10のこと〜
劇的改善 Ci4時間から5分へ〜私がやった10のこと〜
aha_oretama
 
JVM上で動くPython処理系実装のススメ
JVM上で動くPython処理系実装のススメJVM上で動くPython処理系実装のススメ
JVM上で動くPython処理系実装のススメ
Yoshiaki Shibutani
 
Dockerで始める Java EE アプリケーション開発 for JJUG CCC 2017
Dockerで始める Java EE アプリケーション開発 for JJUG CCC 2017Dockerで始める Java EE アプリケーション開発 for JJUG CCC 2017
Dockerで始める Java EE アプリケーション開発 for JJUG CCC 2017
Kohei Saito
 
JEP280: Java 9 で文字列結合の処理が変わるぞ!準備はいいか!? #jjug_ccc
JEP280: Java 9 で文字列結合の処理が変わるぞ!準備はいいか!? #jjug_cccJEP280: Java 9 で文字列結合の処理が変わるぞ!準備はいいか!? #jjug_ccc
JEP280: Java 9 で文字列結合の処理が変わるぞ!準備はいいか!? #jjug_ccc
YujiSoftware
 
Business Process Modeling in Goldman Sachs @ JJUG CCC Fall 2017
Business Process Modeling in Goldman Sachs @ JJUG CCC Fall 2017Business Process Modeling in Goldman Sachs @ JJUG CCC Fall 2017
Business Process Modeling in Goldman Sachs @ JJUG CCC Fall 2017
tty fky
 
サーバサイド Kotlin
サーバサイド Kotlinサーバサイド Kotlin
サーバサイド Kotlin
Hiroki Ohtani
 
Selenide or Geb 〜あなたはその時どちらを使う〜
Selenide or Geb 〜あなたはその時どちらを使う〜Selenide or Geb 〜あなたはその時どちらを使う〜
Selenide or Geb 〜あなたはその時どちらを使う〜
Youtarou TAKAHASHI
 
Another compilation method in java - AOT (Ahead of Time) compilation
Another compilation method in java - AOT (Ahead of Time) compilationAnother compilation method in java - AOT (Ahead of Time) compilation
Another compilation method in java - AOT (Ahead of Time) compilation
Logico
 
サンプルアプリケーションで学ぶApache Cassandraを使ったJavaアプリケーションの作り方
サンプルアプリケーションで学ぶApache Cassandraを使ったJavaアプリケーションの作り方サンプルアプリケーションで学ぶApache Cassandraを使ったJavaアプリケーションの作り方
サンプルアプリケーションで学ぶApache Cassandraを使ったJavaアプリケーションの作り方
Yuki Morishita
 
Javaアプリケーションの モダナイゼーションアプローチ
Javaアプリケーションの モダナイゼーションアプローチJavaアプリケーションの モダナイゼーションアプローチ
Javaアプリケーションの モダナイゼーションアプローチ
CData Software Japan
 
Open Liberty: オープンソースになったWebSphere Liberty
Open Liberty: オープンソースになったWebSphere LibertyOpen Liberty: オープンソースになったWebSphere Liberty
Open Liberty: オープンソースになったWebSphere Liberty
Takakiyo Tanaka
 
将来 自分で サービスを持ちたいエンジニアの葛藤
将来 自分で サービスを持ちたいエンジニアの葛藤 将来 自分で サービスを持ちたいエンジニアの葛藤
将来 自分で サービスを持ちたいエンジニアの葛藤
Yoshio Kajikuri
 
高速なソートアルゴリズムを書こう!!
高速なソートアルゴリズムを書こう!!高速なソートアルゴリズムを書こう!!
高速なソートアルゴリズムを書こう!!
masakazu matsubara
 
マルチクラウドデータ連携Javaアプリケーションの作り方
マルチクラウドデータ連携Javaアプリケーションの作り方マルチクラウドデータ連携Javaアプリケーションの作り方
マルチクラウドデータ連携Javaアプリケーションの作り方
CData Software Japan
 
Polyglot on the JVM with Graal (English)
Polyglot on the JVM with Graal (English)Polyglot on the JVM with Graal (English)
Polyglot on the JVM with Graal (English)
Logico
 
DDD x CQRS 更新系と参照系で異なるORMを併用して上手くいった話
DDD x CQRS   更新系と参照系で異なるORMを併用して上手くいった話DDD x CQRS   更新系と参照系で異なるORMを併用して上手くいった話
DDD x CQRS 更新系と参照系で異なるORMを併用して上手くいった話
Koichiro Matsuoka
 
AI and Machine Learning Demystified by Carol Smith at Midwest UX 2017
AI and Machine Learning Demystified by Carol Smith at Midwest UX 2017AI and Machine Learning Demystified by Carol Smith at Midwest UX 2017
AI and Machine Learning Demystified by Carol Smith at Midwest UX 2017
Carol Smith
 
Ad

Similar to Java9を迎えた今こそ!Java本格(再)入門 (20)

Ingesting streaming data for analysis in apache ignite (stream sets theme)
Ingesting streaming data for analysis in apache ignite (stream sets theme)Ingesting streaming data for analysis in apache ignite (stream sets theme)
Ingesting streaming data for analysis in apache ignite (stream sets theme)
Tom Diederich
 
Oczyszczacz powietrza i stos sieciowy? Czas na test! Semihalf Barcamp 13/06/2018
Oczyszczacz powietrza i stos sieciowy? Czas na test! Semihalf Barcamp 13/06/2018Oczyszczacz powietrza i stos sieciowy? Czas na test! Semihalf Barcamp 13/06/2018
Oczyszczacz powietrza i stos sieciowy? Czas na test! Semihalf Barcamp 13/06/2018
Semihalf
 
Groovy Introduction - JAX Germany - 2008
Groovy Introduction - JAX Germany - 2008Groovy Introduction - JAX Germany - 2008
Groovy Introduction - JAX Germany - 2008
Guillaume Laforge
 
Developing Your Own Flux Packages by David McKay | Head of Developer Relation...
Developing Your Own Flux Packages by David McKay | Head of Developer Relation...Developing Your Own Flux Packages by David McKay | Head of Developer Relation...
Developing Your Own Flux Packages by David McKay | Head of Developer Relation...
InfluxData
 
Apidays Paris 2023 - Forget TypeScript, Choose Rust to build Robust, Fast and...
Apidays Paris 2023 - Forget TypeScript, Choose Rust to build Robust, Fast and...Apidays Paris 2023 - Forget TypeScript, Choose Rust to build Robust, Fast and...
Apidays Paris 2023 - Forget TypeScript, Choose Rust to build Robust, Fast and...
apidays
 
Leap Ahead with Redis 6.2
Leap Ahead with Redis 6.2Leap Ahead with Redis 6.2
Leap Ahead with Redis 6.2
VMware Tanzu
 
GDG Devfest 2019 - Build go kit microservices at kubernetes with ease
GDG Devfest 2019 - Build go kit microservices at kubernetes with easeGDG Devfest 2019 - Build go kit microservices at kubernetes with ease
GDG Devfest 2019 - Build go kit microservices at kubernetes with ease
KAI CHU CHUNG
 
Logstash-Elasticsearch-Kibana
Logstash-Elasticsearch-KibanaLogstash-Elasticsearch-Kibana
Logstash-Elasticsearch-Kibana
dknx01
 
maxbox starter72 multilanguage coding
maxbox starter72 multilanguage codingmaxbox starter72 multilanguage coding
maxbox starter72 multilanguage coding
Max Kleiner
 
Codable routing
Codable routingCodable routing
Codable routing
Pushkar Kulkarni
 
Avro, la puissance du binaire, la souplesse du JSON
Avro, la puissance du binaire, la souplesse du JSONAvro, la puissance du binaire, la souplesse du JSON
Avro, la puissance du binaire, la souplesse du JSON
Alexandre Victoor
 
Embedded Typesafe Domain Specific Languages for Java
Embedded Typesafe Domain Specific Languages for JavaEmbedded Typesafe Domain Specific Languages for Java
Embedded Typesafe Domain Specific Languages for Java
Jevgeni Kabanov
 
LendingClub RealTime BigData Platform with Oracle GoldenGate
LendingClub RealTime BigData Platform with Oracle GoldenGateLendingClub RealTime BigData Platform with Oracle GoldenGate
LendingClub RealTime BigData Platform with Oracle GoldenGate
Rajit Saha
 
Introduction To Groovy 2005
Introduction To Groovy 2005Introduction To Groovy 2005
Introduction To Groovy 2005
Tugdual Grall
 
CGI.ppt
CGI.pptCGI.ppt
CGI.ppt
Vivekanandhan Vijayan
 
Java fx smart code econ
Java fx smart code econJava fx smart code econ
Java fx smart code econ
Tom Schindl
 
A Practical Introduction to Handling Log Data in ClickHouse, by Robert Hodges...
A Practical Introduction to Handling Log Data in ClickHouse, by Robert Hodges...A Practical Introduction to Handling Log Data in ClickHouse, by Robert Hodges...
A Practical Introduction to Handling Log Data in ClickHouse, by Robert Hodges...
Altinity Ltd
 
Metrics with Ganglia
Metrics with GangliaMetrics with Ganglia
Metrics with Ganglia
Gareth Rushgrove
 
Pumps, Compressors and Turbine Fault Frequency Analysis
Pumps, Compressors and Turbine Fault Frequency AnalysisPumps, Compressors and Turbine Fault Frequency Analysis
Pumps, Compressors and Turbine Fault Frequency Analysis
University of Illinois,Chicago
 
Build resource server &amp; client for OCF Cloud (2018.8.30)
Build resource server &amp; client for OCF Cloud (2018.8.30)Build resource server &amp; client for OCF Cloud (2018.8.30)
Build resource server &amp; client for OCF Cloud (2018.8.30)
남균 김
 
Ingesting streaming data for analysis in apache ignite (stream sets theme)
Ingesting streaming data for analysis in apache ignite (stream sets theme)Ingesting streaming data for analysis in apache ignite (stream sets theme)
Ingesting streaming data for analysis in apache ignite (stream sets theme)
Tom Diederich
 
Oczyszczacz powietrza i stos sieciowy? Czas na test! Semihalf Barcamp 13/06/2018
Oczyszczacz powietrza i stos sieciowy? Czas na test! Semihalf Barcamp 13/06/2018Oczyszczacz powietrza i stos sieciowy? Czas na test! Semihalf Barcamp 13/06/2018
Oczyszczacz powietrza i stos sieciowy? Czas na test! Semihalf Barcamp 13/06/2018
Semihalf
 
Groovy Introduction - JAX Germany - 2008
Groovy Introduction - JAX Germany - 2008Groovy Introduction - JAX Germany - 2008
Groovy Introduction - JAX Germany - 2008
Guillaume Laforge
 
Developing Your Own Flux Packages by David McKay | Head of Developer Relation...
Developing Your Own Flux Packages by David McKay | Head of Developer Relation...Developing Your Own Flux Packages by David McKay | Head of Developer Relation...
Developing Your Own Flux Packages by David McKay | Head of Developer Relation...
InfluxData
 
Apidays Paris 2023 - Forget TypeScript, Choose Rust to build Robust, Fast and...
Apidays Paris 2023 - Forget TypeScript, Choose Rust to build Robust, Fast and...Apidays Paris 2023 - Forget TypeScript, Choose Rust to build Robust, Fast and...
Apidays Paris 2023 - Forget TypeScript, Choose Rust to build Robust, Fast and...
apidays
 
Leap Ahead with Redis 6.2
Leap Ahead with Redis 6.2Leap Ahead with Redis 6.2
Leap Ahead with Redis 6.2
VMware Tanzu
 
GDG Devfest 2019 - Build go kit microservices at kubernetes with ease
GDG Devfest 2019 - Build go kit microservices at kubernetes with easeGDG Devfest 2019 - Build go kit microservices at kubernetes with ease
GDG Devfest 2019 - Build go kit microservices at kubernetes with ease
KAI CHU CHUNG
 
Logstash-Elasticsearch-Kibana
Logstash-Elasticsearch-KibanaLogstash-Elasticsearch-Kibana
Logstash-Elasticsearch-Kibana
dknx01
 
maxbox starter72 multilanguage coding
maxbox starter72 multilanguage codingmaxbox starter72 multilanguage coding
maxbox starter72 multilanguage coding
Max Kleiner
 
Avro, la puissance du binaire, la souplesse du JSON
Avro, la puissance du binaire, la souplesse du JSONAvro, la puissance du binaire, la souplesse du JSON
Avro, la puissance du binaire, la souplesse du JSON
Alexandre Victoor
 
Embedded Typesafe Domain Specific Languages for Java
Embedded Typesafe Domain Specific Languages for JavaEmbedded Typesafe Domain Specific Languages for Java
Embedded Typesafe Domain Specific Languages for Java
Jevgeni Kabanov
 
LendingClub RealTime BigData Platform with Oracle GoldenGate
LendingClub RealTime BigData Platform with Oracle GoldenGateLendingClub RealTime BigData Platform with Oracle GoldenGate
LendingClub RealTime BigData Platform with Oracle GoldenGate
Rajit Saha
 
Introduction To Groovy 2005
Introduction To Groovy 2005Introduction To Groovy 2005
Introduction To Groovy 2005
Tugdual Grall
 
Java fx smart code econ
Java fx smart code econJava fx smart code econ
Java fx smart code econ
Tom Schindl
 
A Practical Introduction to Handling Log Data in ClickHouse, by Robert Hodges...
A Practical Introduction to Handling Log Data in ClickHouse, by Robert Hodges...A Practical Introduction to Handling Log Data in ClickHouse, by Robert Hodges...
A Practical Introduction to Handling Log Data in ClickHouse, by Robert Hodges...
Altinity Ltd
 
Pumps, Compressors and Turbine Fault Frequency Analysis
Pumps, Compressors and Turbine Fault Frequency AnalysisPumps, Compressors and Turbine Fault Frequency Analysis
Pumps, Compressors and Turbine Fault Frequency Analysis
University of Illinois,Chicago
 
Build resource server &amp; client for OCF Cloud (2018.8.30)
Build resource server &amp; client for OCF Cloud (2018.8.30)Build resource server &amp; client for OCF Cloud (2018.8.30)
Build resource server &amp; client for OCF Cloud (2018.8.30)
남균 김
 
Ad

Recently uploaded (20)

SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 

Java9を迎えた今こそ!Java本格(再)入門

  • 2. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 2 Java 
 Chapter 7 
 Chapter 8 
 Chapter 9 
 Chapter 12 
 Acroquest Technology 
 - 2017 3 
 2Twitter: @omochiya -
  • 3. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 3 
 

  • 4. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 4 
 
 
 

  • 5. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 1.Introduction 2.Java 1.4 -> 5.0 3.Java 5.0 -> 7 4.Java 7 -> 8 5.Java 8 -> 9 6.Java 9 -> Future 5
  • 6. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 
 6
  • 7. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 7
  • 8. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 8 CSV File 2017-09-25,100,123456,Acroquest, 2017-10-02,100,-28980, , 2017-10-03,100,-17712, , 2017-10-20,100,3000000,gihyo, 2017-10-25,100,200000,Acroquest, 
 , , , , etc
  • 9. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 9
  • 10. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 10 List read(String fileName) { SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); List list = new ArrayList(); BufferedReader reader = null; try { reader = new BufferedReader(new InputStreamReader(new FileInputStream(fileName), "UTF-8")); String line; while ((line = reader.readLine()) != null) { String[] s = line.split(","); Transaction tx = new Transaction(); tx.date = df.parse(s[0]); tx.accountId = s[1]; tx.amount = Integer.valueOf(s[2]); tx.name = s[3]; tx.note = s[4]; list.add(tx); } } catch (ParseException e) { throw new RuntimeException("failed to parse date", e); } catch (IOException e) { throw new RuntimeException("failed to read file: " + fileName, e); } finally { try { if (reader != null) { reader.close(); } } catch (IOException e) { // ignore } } return list; } CSV
  • 11. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 1/3 11 List read(String fileName) { SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); List list = new ArrayList(); BufferedReader reader = null; try { reader = new BufferedReader(new InputStreamReader(
 new FileInputStream(fileName), "UTF-8")); CSV
  • 12. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 2/3 12 String line; while ((line = reader.readLine()) != null) { String[] s = line.split(","); Transaction tx = new Transaction(); tx.date = df.parse(s[0]); tx.accountId = s[1]; tx.amount = Integer.valueOf(s[2]); tx.name = s[3]; tx.note = s[4]; list.add(tx);
 } CSV
  • 13. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 3/3 13 } catch (ParseException e) { throw new RuntimeException("failed to parse date", e); } catch (IOException e) { throw new RuntimeException("failed to read file: " + fileName, e); } finally { try { if (reader != null) { reader.close(); } } catch (IOException e) { // ignore } } return list; } finally close CSV
  • 14. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 Transaction 14 class Transaction { Date date; String accountId; Integer amount; String name; String note; public Transaction() { } public Transaction(Date date, String accountId, Integer amount, String name, String note) { this.date = date; this.accountId = accountId; this.amount = amount; this.name = name; this.note = note; } public String toString() { return date + " " + accountId + " " + amount + " " + name + " " + note; } } CSV
  • 15. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 Transaction 1/2 15 class Transaction { Date date; String accountId; Integer amount; String name; String note; public Transaction() { } CSV
  • 16. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 Transaction 2/2 16 public Transaction(Date date, String accountId, Integer amount, 
 String name, String note) { this.date = date; this.accountId = accountId; this.amount = amount; this.name = name; this.note = note; } public String toString() { return date + " " + accountId + " " + amount + " " + name + " " + note; } } CSV
  • 17. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 - 17 List list = read(fileName); int sum = 0; for (int i = 0; i < list.size(); i++) { Transaction tx = (Transaction) list.get(i); sum += tx.amount; } System.out.println(sum); CSV
  • 18. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 - 6 18 List list = read(fileName); for (int i = 0; i < list.size(); i++) { Transaction tx = (Transaction) list.get(i); Calendar cal = Calendar.getInstance(); cal.setTime(tx.date); if (cal.get(Calendar.MONTH) == 5) { System.out.println(tx); } } 0 CSV
  • 19. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 
 19
  • 20. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 20
  • 21. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 
 21
  • 22. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 1/3 22 List read(String fileName) { SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); List list = new ArrayList(); BufferedReader reader = null; try { reader = new BufferedReader(new InputStreamReader(
 new FileInputStream(fileName), "UTF-8")); CSV
  • 23. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 1/3 23 List<Transaction> read(String fileName) { SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); List<Transaction> list = new ArrayList<Transaction>(); BufferedReader reader = null; try { reader = new BufferedReader(new InputStreamReader(
 new FileInputStream(fileName), "UTF-8")); CSV
  • 24. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 1/3 24 List<Transaction> read(String fileName) { SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); List<Transaction> list = new ArrayList<Transaction>(); BufferedReader reader = null; try { reader = new BufferedReader(new InputStreamReader(
 new FileInputStream(fileName), "UTF-8")); Generics 
 → 
 → CSV
  • 25. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 - 25 List list = read(fileName); int sum = 0; for (int i = 0; i < list.size(); i++) { Transaction tx = (Transaction) list.get(i); sum += tx.amount; } System.out.println(sum); CSV
  • 26. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 - 26 List<Transaction> list = read(fileName); int sum = 0; for (Transaction tx : list) { sum += tx.amount; } System.out.println(sum); CSV
  • 27. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 - 27 List<Transaction> list = read(fileName); int sum = 0; for (Transaction tx : list) { sum += tx.amount; } System.out.println(sum); CSV for 
 →
  • 28. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 
 28
  • 29. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 Transaction 2/2 29 public Transaction(Date date, String accountId, Integer amount, 
 String name, String note) { this.date = date; this.accountId = accountId; this.amount = amount; this.name = name; this.note = note; } public String toString() { return date + " " + accountId + " " + amount + " " + name + " " + note; } } CSV
  • 30. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 Transaction 2/2 30 public Transaction(Date date, String accountId, Integer amount, 
 String name, String note) { this.date = date; this.accountId = accountId; this.amount = amount; this.name = name; this.note = note; } @Override public String toString() { return date + " " + accountId + " " + amount + " " + name + " " + note; } } CSV
  • 31. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 Transaction 2/2 31 public Transaction(Date date, String accountId, Integer amount, 
 String name, String note) { this.date = date; this.accountId = accountId; this.amount = amount; this.name = name; this.note = note; } @Override public String toString() { return date + " " + accountId + " " + amount + " " + name + " " + note; } } 
 → Override CSV
  • 32. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 32
  • 33. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 33
  • 34. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 
 34
  • 35. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 
 35
  • 36. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 1/3 36 List<Transaction> read(String fileName) { SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); List<Transaction> list = new ArrayList<Transaction>(); BufferedReader reader = null; try { reader = new BufferedReader(new InputStreamReader(
 new FileInputStream(fileName), "UTF-8")); CSV
  • 37. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 1/3 37 List<Transaction> read(String fileName) { SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); List<Transaction> list = new ArrayList<>(); try (BufferedReader reader = Files.newBufferedReader(Paths.get(fileName), StandardCharsets.UTF_8)) { CSV
  • 38. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 1/3 38 List<Transaction> read(String fileName) { SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); List<Transaction> list = new ArrayList<>(); try (BufferedReader reader = Files.newBufferedReader(Paths.get(fileName), StandardCharsets.UTF_8)) { CSV
  • 39. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 1/3 39 List<Transaction> read(String fileName) { SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); List<Transaction> list = new ArrayList<>(); try (BufferedReader reader = Files.newBufferedReader(Paths.get(fileName), StandardCharsets.UTF_8)) { try-with-resoureces 
 try ( ) close 
 → 
 → 
 CSV
  • 40. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 
 40
  • 41. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 1/3 41 List<Transaction> read(String fileName) { SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); List<Transaction> list = new ArrayList<>(); try (BufferedReader reader = Files.newBufferedReader(Paths.get(fileName), StandardCharsets.UTF_8)) { Files nio2 CSV
  • 42. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 1/3 42 List<Transaction> read(String fileName) { SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); List<Transaction> list = new ArrayList<>(); try (BufferedReader reader = Files.newBufferedReader(Paths.get(fileName), StandardCharsets.UTF_8)) { String Charset 
 StandardCharsets 
 → CSV
  • 43. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 3/3 43 } catch (ParseException e) { throw new RuntimeException("failed to parse date", e); } catch (IOException e) { throw new RuntimeException("failed to read file: " + fileName, e); } finally { try { if (reader != null) { reader.close(); } } catch (IOException e) { // ignore } } return list; } CSV
  • 44. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 3/3 44 } catch (ParseException | IOException e) { throw new RuntimeException("failed to parse date or read file”, e); } return list; } catch 
 CSV
  • 45. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 
 45
  • 46. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 46
  • 47. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 47
  • 48. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 
 48
  • 49. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 
 
 49
  • 50. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 
 50
  • 51. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 Transaction toString 51 class Transaction { Date date; String accountId; Integer amount; String name; String note; public Transaction() { } public Transaction(Date date, String accountId, Integer amount, String name, String note) { this.date = date; this.accountId = accountId; this.amount = amount; this.name = name; this.note = note; } CSV
  • 52. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 Transaction toString 52 class Transaction { LocalDate date; String accountId; Integer amount; String name; String note; public Transaction() { } public Transaction(LocalDate date, String accountId, Integer amount, String name, String note) { this.date = date; this.accountId = accountId; this.amount = amount; this.name = name; this.note = note; } CSV
  • 53. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 Transaction toString 53 class Transaction { LocalDate date; String accountId; Integer amount; String name; String note; public Transaction() { } public Transaction(LocalDate date, String accountId, Integer amount, String name, String note) { this.date = date; this.accountId = accountId; this.amount = amount; this.name = name; this.note = note; } Date and Time API
 →LocalDate 
 LocalDateTime LocalTime 
 OffsetDateTime ZonedDateTime 
 CSV
  • 54. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 
 
 
 
 54
  • 55. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 55 List<Transaction> read(String fileName) { SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); List<Transaction> list = new ArrayList<>(); try (BufferedReader reader = Files.newBufferedReader(Paths.get(fileName), StandardCharsets.UTF_8)) { String line; while ((line = reader.readLine()) != null) { String[] s = line.split(","); Transaction tx = new Transaction(); tx.date = df.parse(s[0]); tx.accountId = s[1]; tx.amount = Integer.valueOf(s[2]); tx.name = s[3]; tx.note = s[4]; list.add(tx);
 } CSV
  • 56. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 56 List<Transaction> read(String fileName) { // SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); List<Transaction> list = new ArrayList<>(); try (BufferedReader reader = Files.newBufferedReader(Paths.get(fileName))) { String line; while ((line = reader.readLine()) != null) { String[] s = line.split(","); Transaction tx = new Transaction(); tx.date = LocalDate.parse(s[0]); tx.accountId = s[1]; tx.amount = Integer.valueOf(s[2]); tx.name = s[3]; tx.note = s[4]; list.add(tx);
 } CSV
  • 57. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 57 List<Transaction> read(String fileName) { // SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); List<Transaction> list = new ArrayList<>(); try (BufferedReader reader = Files.newBufferedReader(Paths.get(fileName))) { String line; while ((line = reader.readLine()) != null) { String[] s = line.split(","); Transaction tx = new Transaction(); tx.date = LocalDate.parse(s[0]); tx.accountId = s[1]; tx.amount = Integer.valueOf(s[2]); tx.name = s[3]; tx.note = s[4]; list.add(tx);
 } UTF-8 Charset 
 ISO 8601 
 CSV
  • 58. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 
 58
  • 59. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 - 6 59 List<Transaction> list = read(fileName); for (Transaction tx : list) { Calendar cal = Calendar.getInstance(); cal.setTime(tx.date); if (cal.get(Calendar.MONTH) == 5) { System.out.println(tx); } } CSV
  • 60. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 - 6 60 List<Transaction> list = read(fileName); for (Transaction tx : list) { if (tx.date.getMonth() == Month.JUNE) { System.out.println(tx); } } CSV
  • 61. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 - 6 61 List<Transaction> list = read(fileName); for (Transaction tx : list) { if (tx.date.getMonth() == Month.JUNE) { System.out.println(tx); } } enum 
 enum 
 → 0 
 CSV
  • 62. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 
 
 62
  • 63. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 63
  • 64. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 
 
 64
  • 65. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 
 65
  • 66. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 66 List<Transaction> list = new ArrayList<>(); try (BufferedReader reader = Files.newBufferedReader(Paths.get(fileName))) { String line; while ((line = reader.readLine()) != null) { String[] s = line.split(","); Transaction tx = new Transaction(); tx.date = LocalDate.parse(s[0]); tx.accountId = s[1]; tx.amount = Integer.valueOf(s[2]); tx.name = s[3]; tx.note = s[4]; list.add(tx);
 } } catch (ParseException | IOException e) { throw new RuntimeException("failed to parse date or read file”, e); } return list; CSV
  • 67. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 67 try (Stream<String> stream = Files.lines(Paths.get(fileName))) { return stream .map(line -> { String[] s = line.split(","); Transaction tx = new Transaction(); tx.date = LocalDate.parse(s[0]); tx.accountId = s[1]; tx.amount = Integer.valueOf(s[2]); tx.name = s[3]; tx.note = s[4]; return tx; }) .collect(Collectors.toList()); } catch (ParseException | IOException e) { throw new UncheckedIOException("failed to read file", e); } CSV
  • 68. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 68 try (Stream<String> stream = Files.lines(Paths.get(fileName))) { return stream .map(line -> { String[] s = line.split(","); Transaction tx = new Transaction(); tx.date = LocalDate.parse(s[0]); tx.accountId = s[1]; tx.amount = Integer.valueOf(s[2]); tx.name = s[3]; tx.note = s[4]; return tx; }) .collect(Collectors.toList()); } catch (ParseException | IOException e) { throw new UncheckedIOException("failed to read file", e); } 
 Stream 
 List CSV 
 String Transaction
  • 69. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 69 try (Stream<String> stream = Files.lines(Paths.get(fileName))) { return stream .map(line -> { String[] s = line.split(","); Transaction tx = new Transaction(); tx.date = LocalDate.parse(s[0]); tx.accountId = s[1]; tx.amount = Integer.valueOf(s[2]); tx.name = s[3]; tx.note = s[4]; return tx; }) .collect(Collectors.toList()); } catch (ParseException | IOException e) { throw new UncheckedIOException("failed to read file", e); } Lambda CSV
  • 70. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 1 70 // List<Transaction> list = read(fileName); // for (Transaction tx : list) { System.out.println(tx); } // int sum = 0; for (Transaction tx : list) { sum += tx.amount; } System.out.println(sum); CSV
  • 71. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 1 71 // read(fileName).stream() .forEach(System.out::println); // int sum = read(fileName).stream() .mapToInt(tx -> tx.amount) .sum(); System.out.println(sum); CSV
  • 72. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 1 72 // read(fileName).stream() .forEach(System.out::println); // int sum = read(fileName).stream() .mapToInt(tx -> tx.amount) .sum(); System.out.println(sum); int CSV 

  • 73. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 1 73 // read(fileName).stream() .forEach(System.out::println); // int sum = read(fileName).stream() .mapToInt(tx -> tx.amount) .sum(); System.out.println(sum); Lambda CSV
  • 74. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 2 74 // 6 
 for (Transaction tx : list) { if (tx.date.getMonth() == Month.JUNE) { System.out.println(tx); } } CSV
  • 75. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 2 75 // 6 read(fileName).stream() .filter(tx -> tx.date.getMonth() == Month.JUNE) .forEach(System.out::println); CSV
  • 76. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 2 76 // 6 read(fileName).stream() .filter(tx -> tx.date.getMonth() == Month.JUNE) .forEach(System.out::println); 6 filter CSV
  • 77. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 2 77 // 6 read(fileName).stream() .filter(tx -> tx.date.getMonth() == Month.JUNE) .forEach(System.out::println); Lambda
  • 78. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 
 
 78
  • 79. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 
 
 79
  • 80. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 
 
 80
  • 81. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 
 81
  • 82. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 
 82
  • 83. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 83
  • 84. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 
 
 
 84
  • 85. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 
 
 85
  • 86. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 
 
 86
  • 87. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 
 
 
 
 87
  • 88. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 
 
 88
  • 89. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 
 
 
 89
  • 90. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 90 try (Stream<String> stream = Files.lines(Paths.get(fileName))) { return stream .map(line -> { String[] s = line.split(","); Transaction tx = new Transaction(); tx.date = LocalDate.parse(s[0]); tx.accountId = s[1]; tx.amount = Integer.valueOf(s[2]); tx.name = s[3]; tx.note = s[4]; return tx; }) .collect(Collectors.toList()); } catch (ParseException | IOException e) { throw new UncheckedIOException("failed to read file", e); } 
 String Transaction List
  • 91. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 1 91 // read(fileName).stream() .forEach(System.out::println); // int sum = read(fileName).stream() .mapToInt(tx -> tx.amount) .sum(); System.out.println(sum); 
 int
  • 92. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 2 92 // 6 read(fileName).stream() .filter(tx -> tx.date.getMonth() == Month.JUNE) .forEach(System.out::println); 6 filter
  • 93. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 
 
 
 93
  • 94. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 
 
 
 94
  • 95. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 
 
 
 
 95
  • 96. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 
 
 
 
 96
  • 97. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 97
  • 98. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 98
  • 99. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 
 
 99
  • 100. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 
 
 
 100
  • 101. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 
 
 
 
 101
  • 102. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 JShell 102 // jshell> List<Integer> intList = List.of(1, 2, 3); intList ==> [1, 2, 3] jshell> List<String> strList = List.of("aaa,", "bbb", “ccc"); strList ==> [aaa,, bbb, ccc] jshell> intList.add(4); | java.lang.UnsupportedOperationException thrown: | at ImmutableCollections.uoe (ImmutableCollections.java:71) ( )
  • 103. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 JShell 103 // jshell> Map<Integer, String> map = 
 Map.of(1, "aaa", 2, "bbb", 3, “ccc"); map ==> {1=aaa, 2=bbb, 3=ccc} jshell> map.put(4, "ddd"); | java.lang.UnsupportedOperationException thrown: | at ImmutableCollections.uoe (ImmutableCollections.java:71) ( )
  • 104. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 104
  • 105. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 105
  • 106. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 
 106 // var str = “Hello”; final var MAXIMUM = 100L; // NG var array = {1, 2, 3}; var list = new ArrayList<>();
  • 107. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 107
  • 108. Copyright © Acroquest Technology Co., Ltd. All rights reserved. #ccc_g3 
 
 
 
 108