Brother Please end me
This commit is contained in:
parent
390b59addf
commit
364fa45534
26 changed files with 378 additions and 2 deletions
7
Code/Steiner/30.10.24-Player-Klasse/.vscode/settings.json
vendored
Normal file
7
Code/Steiner/30.10.24-Player-Klasse/.vscode/settings.json
vendored
Normal file
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"java.project.sourcePaths": ["src"],
|
||||
"java.project.outputPath": "bin",
|
||||
"java.project.referencedLibraries": [
|
||||
"lib/**/*.jar"
|
||||
]
|
||||
}
|
18
Code/Steiner/30.10.24-Player-Klasse/README.md
Normal file
18
Code/Steiner/30.10.24-Player-Klasse/README.md
Normal file
|
@ -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).
|
BIN
Code/Steiner/30.10.24-Player-Klasse/bin/Player.class
Normal file
BIN
Code/Steiner/30.10.24-Player-Klasse/bin/Player.class
Normal file
Binary file not shown.
BIN
Code/Steiner/30.10.24-Player-Klasse/bin/PlayerTest.class
Normal file
BIN
Code/Steiner/30.10.24-Player-Klasse/bin/PlayerTest.class
Normal file
Binary file not shown.
BIN
Code/Steiner/30.10.24-Player-Klasse/src/Player.class
Normal file
BIN
Code/Steiner/30.10.24-Player-Klasse/src/Player.class
Normal file
Binary file not shown.
27
Code/Steiner/30.10.24-Player-Klasse/src/Player.java
Normal file
27
Code/Steiner/30.10.24-Player-Klasse/src/Player.java
Normal file
|
@ -0,0 +1,27 @@
|
|||
public class Player {
|
||||
private int id;
|
||||
private String name;
|
||||
private static int counter = 1;
|
||||
|
||||
Player(String name) {
|
||||
this.id = counter;
|
||||
counter++;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
}
|
BIN
Code/Steiner/30.10.24-Player-Klasse/src/PlayerTest.class
Normal file
BIN
Code/Steiner/30.10.24-Player-Klasse/src/PlayerTest.class
Normal file
Binary file not shown.
13
Code/Steiner/30.10.24-Player-Klasse/src/PlayerTest.java
Normal file
13
Code/Steiner/30.10.24-Player-Klasse/src/PlayerTest.java
Normal file
|
@ -0,0 +1,13 @@
|
|||
public class PlayerTest {
|
||||
public static void main(String[] args) {
|
||||
Player[] players = new Player[20];
|
||||
String[] names = { "Eva", "Fritz", "Anna", "Luca", "Sara", "Max", "Zoe", "Leo", "Nina", "Tom",
|
||||
"Ella", "Jake", "Mia", "Liam", "Sophie", "Noah", "Emma", "Ben", "Olivia", "Eli" };
|
||||
for (int i = 0; i < players.length; i++) {
|
||||
players[i] = new Player(names[i]);
|
||||
}
|
||||
for (Player player : players) {
|
||||
System.out.println(player.getId() + " " + player.getName());
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue