forked from Labore/PR2-L
add IteratorDemo and Standarddatenstroeme
parent
4ba4cec390
commit
cf66899346
|
|
@ -4,6 +4,41 @@
|
||||||
// Weitere Informationen finden Sie unter https://go.microsoft.com/fwlink/?linkid=830387
|
// Weitere Informationen finden Sie unter https://go.microsoft.com/fwlink/?linkid=830387
|
||||||
"version": "0.2.0",
|
"version": "0.2.0",
|
||||||
"configurations": [
|
"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",
|
"type": "java",
|
||||||
"name": "UI",
|
"name": "UI",
|
||||||
|
|
|
||||||
|
|
@ -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());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
"java.project.sourcePaths": ["src"],
|
||||||
|
"java.project.outputPath": "bin",
|
||||||
|
"java.project.referencedLibraries": [
|
||||||
|
"lib/**/*.jar"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -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).
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
"java.project.sourcePaths": ["src"],
|
||||||
|
"java.project.outputPath": "bin",
|
||||||
|
"java.project.referencedLibraries": [
|
||||||
|
"lib/**/*.jar"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -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).
|
||||||
|
|
@ -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!");
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue