Java out.getclass() display class at runtime?

package de.thws; import java.io.IOException; import java.io.InputStream; import java.io.PrintStream; public class SystemInAbgeleitetVon { public static void main(String[] args) throws IOException { PrintStream out = System.out; InputStream in = System.in; int i; do { i = in.read(); if (i != -1) out.write(i); } while (i != -1); System.out.println(out.getClass()); } } Using System.out.println(out.getClass()) I should now be able…

Understanding Java class variable System.out?

I know this answer is correct. I'm concerned about understanding. That means for me: There's a class called Printstream, and it has a class variable called System. This class variable, System, itself has a class variable called out , which I call via System.out. Is that correct? Let's continue to understand System.out.println(…): https://docs.oracle.com/en/java/javase/20/docs/api/java.base/java/lang/System.html I have…

Copy a .text file using a stream in Java?

I want to copy the file "Hello, how are you?" via stream and create a new file called "copy.txt." Why doesn't this work? I get a FileNotFoundException. Code is attached below: package de.thws; // Von mir zum testen von Streams import java.io.*; public class PerStreamDateiEinlesen { public static void main(String[] args) throws FileNotFoundException { copyFileWithErrorHandling3Modularized();…

IntelliJ WSL Gradle accesses wrong partition?

I want to open a Gradle in IntelliJ via WSL2, and up until Configure Successful, there are no problems, but suddenly it wants to open the .gradle folder on another partition. The settings are: Gradle user home: (\\wsl$\Ubuntu) \home\name\.gradle Gradle JVM: 11(WSL) After Configure Successfully the console then displays: F:\home\name\.gradle\jdks\jdk8u362-b09 doesn't exist Why is IntelliJ…

Why does Intellij always give me this error message?

I've been trying to create a new 1.19.2 Minecraft project for a few hours, but I keep getting the same error message every time I run runclient. I haven't edited the project yet and have tried several Forge versions, installed the Java version several times, and tried different versions as well, but I keep getting…