help me lord

This commit is contained in:
Sage The DM 2024-11-23 21:34:00 +01:00
parent fb196693e4
commit db6b2a2a6e
42 changed files with 342 additions and 0 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.

Binary file not shown.

View file

@ -0,0 +1,14 @@
public class App {
public static void main(String[] args) throws Exception {
SimpleCalendar simpleCalendar = new SimpleCalendar();
// Aktuelles Datum und Uhrzeit formatieren und ausgeben
System.out.println("Aktuelles Datum und Uhrzeit:");
System.out.println(simpleCalendar.getFormattedDate());
// Zeit manipulieren
simpleCalendar.add(SimpleCalendar.DAY_OF_MONTH, 5);
System.out.println("Datum in 5 Tagen:");
System.out.println(simpleCalendar.getFormattedDate());
}
}

Binary file not shown.

View file

@ -0,0 +1,15 @@
import java.util.GregorianCalendar;
public class SimpleCalendar extends GregorianCalendar {
public String getFormattedDate() {
int year = get(GregorianCalendar.YEAR);
int month = get(GregorianCalendar.MONTH) + 1; // Monate sind 0-basiert
int day = get(GregorianCalendar.DAY_OF_MONTH);
int hour = get(GregorianCalendar.HOUR_OF_DAY);
int minute = get(GregorianCalendar.MINUTE);
int second = get(GregorianCalendar.SECOND);
return String.format("%02d.%02d.%04d %02d:%02d:%02d", day, month, year, hour, minute, second);
}
}