This commit is contained in:
2024-02-09 12:34:58 +01:00
parent 4d772a17cb
commit 0c970c22a7
98 changed files with 5330 additions and 20 deletions

View File

@@ -1,2 +1,7 @@
package P6;public class A2 {
package P6;
public class A2 {
public static void main(String[] args) {
}
}

View File

@@ -1,2 +1,33 @@
package P6;public class Praktikum {
package P6;
import java.io.BufferedWriter;
import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.*;
import java.time.LocalDateTime;
public class Praktikum {
public static void main(String[] args) {
String home = System.getProperty("user.home");
String login = System.getProperty("user.name");
var time = java.time.LocalDateTime.now();
Path p = Paths.get(home, "java-text.tmp");
try {
if (Files.exists(p))
Files.delete(p);
}catch (IOException ioe){
}
try (var bw = Files.newBufferedWriter(
p, StandardOpenOption.APPEND,
StandardOpenOption.CREATE)){
bw.write(LocalDateTime.now()+"\n");
bw.write("Hello "+login+"\n");
bw.write("Ende\n");
} catch (IOException ex) {
ex.printStackTrace();}
}
}