mirror of
https://gitlab.com/harald.mueller/aktuelle.kurse.git
synced 2024-11-27 20:21:56 +01:00
muh
This commit is contained in:
parent
fc4933293a
commit
ca6e7b5169
@ -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);
|
||||
}
|
||||
}
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user