This commit is contained in:
Harald Mueller 2021-12-09 14:12:08 +01:00
parent fc4933293a
commit ca6e7b5169
15 changed files with 34 additions and 0 deletions

View File

@ -0,0 +1,27 @@
/* package xxx.yyyy; */
import java.io.*;
import java.util.Scanner;
import java.util.stream.Stream;
public class Main {
public static void main(String[] args) {
boolean read=false;
do{
Scanner sc = new Scanner(System.in);
System.out.print("Enter Filename to read:");
String filename=sc.nextLine();
try {
Stream<String> lines=(new BufferedReader(new FileReader(new File(filename)))).lines();
System.out.println("The file contains this:");
lines.forEach(s -> System.out.println(s));
read=true;
} catch (FileNotFoundException e) {
System.out.println("There was a FileNotFoundException when reading the file");
System.out.println("Exception message was:"+e.getMessage());
System.out.print("Stacktrace was:");
e.printStackTrace(System.out);
}
} while (!read);
}
}

View File

@ -17,4 +17,11 @@ Bauen Sie gemäss dieser Anleitung eine (einfache) Verlinkte Liste.
- [Java LinkedList Wie du eine verkettete Liste implementierst. Der Workshop!](http://www.codeadventurer.de/?p=1844)
**Anleitung mit Bildern und Code**
Geeks for Geeks (C, C++, C#, Java, JavaScript, Python. --> Code auf "Java" stellen)
- [1 Introduction](https://www.geeksforgeeks.org/linked-list-set-1-introduction)
- [2 Insert node](https://www.geeksforgeeks.org/linked-list-set-2-inserting-a-node)
- [3 Delete node](https://www.geeksforgeeks.org/linked-list-set-3-deleting-node)
Bewertung: Keine, ist aber prüfungsrelevant