forked from txs72/JavaTutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathReadData.java
More file actions
executable file
·32 lines (30 loc) · 937 Bytes
/
ReadData.java
File metadata and controls
executable file
·32 lines (30 loc) · 937 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
31
32
/* */ package ch12_io;
/* */
/* */ import java.io.File;
/* */ import java.util.Scanner;
/* */
/* */ public class ReadData {
/* */ public static void main(String[] args) throws Exception {
/* 8 */ File file = new File("scores.txt");
/* */
/* */
/* 11 */ Scanner input = new Scanner(file);
/* */
/* */
/* 14 */ while (input.hasNext()) {
/* 15 */ String firstName = input.next();
/* 16 */ String mi = input.next();
/* 17 */ String lastName = input.next();
/* 18 */ int score = input.nextInt();
/* 19 */ System.out.println(firstName + " " + mi + " " + lastName + " " + score);
/* */ }
/* */
/* */
/* */
/* 24 */ input.close();
/* */ }
/* */ }
/* Location: /Volumes/TXS.128G/hope useful/practice/2020.jar!/ch12_io/ReadData.class
* Java compiler version: 8 (52.0)
* JD-Core Version: 1.1.3
*/