diff --git a/.vscode/launch.json b/.vscode/launch.json index 6dc00eb..11c2323 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -4,6 +4,41 @@ // Weitere Informationen finden Sie unter https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ + { + "type": "java", + "name": "Eingabe_BufferedReader", + "request": "launch", + "mainClass": "Eingabe_BufferedReader", + "projectName": "PR2-L_e28f9f2c" + }, + { + "type": "java", + "name": "Eingabe", + "request": "launch", + "mainClass": "Eingabe", + "projectName": "PR2-L_e28f9f2c" + }, + { + "type": "java", + "name": "Roemisch", + "request": "launch", + "mainClass": "Roemisch", + "projectName": "PR2-L_e28f9f2c" + }, + { + "type": "java", + "name": "DemoAnonymeKlasse", + "request": "launch", + "mainClass": "DemoAnonymeKlasse", + "projectName": "PR2-L_e28f9f2c" + }, + { + "type": "java", + "name": "App", + "request": "launch", + "mainClass": "App", + "projectName": "PR2-L_e28f9f2c" + }, { "type": "java", "name": "UI", diff --git a/SeparateU_Logic/.vscode/settings.json b/IteratorDemo/.vscode/settings.json similarity index 100% rename from SeparateU_Logic/.vscode/settings.json rename to IteratorDemo/.vscode/settings.json diff --git a/SeparateU_Logic/README.md b/IteratorDemo/README.md similarity index 100% rename from SeparateU_Logic/README.md rename to IteratorDemo/README.md diff --git a/IteratorDemo/src/App.java b/IteratorDemo/src/App.java new file mode 100644 index 0000000..4cb6e50 --- /dev/null +++ b/IteratorDemo/src/App.java @@ -0,0 +1,16 @@ +import java.util.Iterator; + +public class App { + public static void main(String[] args) throws Exception { + System.out.println("Hello, Iterator!"); + + Sammlung sammlung = new Sammlung(); + + Iterator i = sammlung.iterator(); + + while(i.hasNext()) + { + System.out.println(i.next()); + } + } +} diff --git a/IteratorDemo/src/Sammlung.java b/IteratorDemo/src/Sammlung.java new file mode 100644 index 0000000..64d6f61 --- /dev/null +++ b/IteratorDemo/src/Sammlung.java @@ -0,0 +1,26 @@ +import java.util.Iterator; +import java.util.Scanner; + +public class Sammlung implements Iterator, Iterable +{ + String einKunde = "Gerd\tMarmitt\tMannheim"; + + Scanner einScanner = new Scanner(einKunde).useDelimiter("\\t"); + + public boolean hasNext() { + return einScanner.hasNext(); + } + + public Object next() { + return einScanner.next(); + } + + public void remove() { + throw new UnsupportedOperationException(); + } + + // zusaetzlich fuer Iterable + public Iterator iterator() { + return this; + } +} \ No newline at end of file diff --git a/SeparateUI_Logic/.vscode/settings.json b/SeparateUI_Logic/.vscode/settings.json new file mode 100644 index 0000000..0ac215c --- /dev/null +++ b/SeparateUI_Logic/.vscode/settings.json @@ -0,0 +1,7 @@ +{ + "java.project.sourcePaths": ["src"], + "java.project.outputPath": "bin", + "java.project.referencedLibraries": [ + "lib/**/*.jar" + ] +} diff --git a/SeparateUI_Logic/README.md b/SeparateUI_Logic/README.md new file mode 100644 index 0000000..a43b9f6 --- /dev/null +++ b/SeparateUI_Logic/README.md @@ -0,0 +1,18 @@ +## Getting Started + +Welcome to the VS Code Java world. Here is a guideline to help you get started to write Java code in Visual Studio Code. + +## Folder Structure + +The workspace contains two folders by default, where: + +- `src`: the folder to maintain sources +- `lib`: the folder to maintain dependencies + +Meanwhile, the compiled output files will be generated in the `bin` folder by default. + +> If you want to customize the folder structure, open `.vscode/settings.json` and update the related settings there. + +## Dependency Management + +The `JAVA PROJECTS` view allows you to manage your dependencies. More details can be found [here](https://github.com/microsoft/vscode-java-dependency#manage-dependencies). diff --git a/SeparateU_Logic/src/Logic.java b/SeparateUI_Logic/src/Logic.java similarity index 100% rename from SeparateU_Logic/src/Logic.java rename to SeparateUI_Logic/src/Logic.java diff --git a/SeparateU_Logic/src/UI.java b/SeparateUI_Logic/src/UI.java similarity index 100% rename from SeparateU_Logic/src/UI.java rename to SeparateUI_Logic/src/UI.java diff --git a/Standarddatenstroeme/.vscode/settings.json b/Standarddatenstroeme/.vscode/settings.json new file mode 100644 index 0000000..0ac215c --- /dev/null +++ b/Standarddatenstroeme/.vscode/settings.json @@ -0,0 +1,7 @@ +{ + "java.project.sourcePaths": ["src"], + "java.project.outputPath": "bin", + "java.project.referencedLibraries": [ + "lib/**/*.jar" + ] +} diff --git a/Standarddatenstroeme/README.md b/Standarddatenstroeme/README.md new file mode 100644 index 0000000..a43b9f6 --- /dev/null +++ b/Standarddatenstroeme/README.md @@ -0,0 +1,18 @@ +## Getting Started + +Welcome to the VS Code Java world. Here is a guideline to help you get started to write Java code in Visual Studio Code. + +## Folder Structure + +The workspace contains two folders by default, where: + +- `src`: the folder to maintain sources +- `lib`: the folder to maintain dependencies + +Meanwhile, the compiled output files will be generated in the `bin` folder by default. + +> If you want to customize the folder structure, open `.vscode/settings.json` and update the related settings there. + +## Dependency Management + +The `JAVA PROJECTS` view allows you to manage your dependencies. More details can be found [here](https://github.com/microsoft/vscode-java-dependency#manage-dependencies). diff --git a/Standarddatenstroeme/src/Standarddatenstroeme.java b/Standarddatenstroeme/src/Standarddatenstroeme.java new file mode 100644 index 0000000..11b1594 --- /dev/null +++ b/Standarddatenstroeme/src/Standarddatenstroeme.java @@ -0,0 +1,10 @@ +public class Standarddatenstroeme { + public static void main(String[] args) throws Exception { + + // Ausgabe umleiten mit 1> + System.out.println("Hello, World!"); + + // Aussgabe umleiten mit 2> + System.err.println("Hello, Error!"); + } +}