forked from PacktPublishing/Java-Coding-Problems
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
23 lines (16 loc) · 763 Bytes
/
Main.java
File metadata and controls
23 lines (16 loc) · 763 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package modern.challenge;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.List;
public class Main {
private static final String COMMA_DELIMITER = ",";
public static void main(String[] args) throws IOException {
Path path = Paths.get("melon.csv");
List<List<String>> resultAsObject = Csvs.readAsObject(path, StandardCharsets.UTF_8, COMMA_DELIMITER);
System.out.println("Result as Object: " + resultAsObject);
List<Melon> resultAsMelon = Csvs.readAsMelon(path, StandardCharsets.UTF_8, COMMA_DELIMITER);
System.out.println("Result as Melon: " + resultAsMelon);
}
}