1
0

Add chapters 9-17 for the java book

This commit is contained in:
2025-12-01 14:14:57 +01:00
parent a680b83e47
commit 2da137aea8
54 changed files with 3063 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
import java.io.*;
public class Task2 {
public static void main(String[] args) {
FileInputStream fileReader = null;
try {
fileReader = new FileInputStream("../1/Notizen.txt");
} catch (FileNotFoundException exception) {
System.out.println(exception.getMessage());
return;
}
var inputStream = new InputStreamReader(fileReader);
var bufferedStream = new BufferedReader(inputStream);
try {
String input = bufferedStream.readLine();
int counter = 1;
while (input != null) {
System.out.println(counter + ". " + input);
++counter;
input = bufferedStream.readLine();
}
bufferedStream.close();
} catch (IOException exception) {
System.out.println(exception.getMessage());
}
}
}