Brother Please end me

This commit is contained in:
Sage The DM 2024-10-30 16:02:50 +01:00
parent 390b59addf
commit 364fa45534
26 changed files with 378 additions and 2 deletions

View file

@ -0,0 +1,7 @@
{
"java.project.sourcePaths": ["src"],
"java.project.outputPath": "bin",
"java.project.referencedLibraries": [
"lib/**/*.jar"
]
}

View 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).

Binary file not shown.

Binary file not shown.

View 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;
}
}

View 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());
}
}
}