hallo,
mein skript fu8nktioniert nicht bei dem befehl "public class InputZahl {"
ganzes skript hierrbei:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class InputZahl {
public static void main(String[] args) throws IOException {
BufferedReader stdin = new BufferedReader(new InputStreamReader(
System.in));
String input;
Int zahl, ergebnis;
System.out.println("Geben Sie eine ganze Zahl ein:");
input = stdin.readLine();
zahl = Integer.parseInt(input);
ergebnis = zahl + zahl;
System.out.println("Das Ergebnis der Multiplikation von " + zahl
+ " und " + zahl + " ergibt " + ergebnis);
}
}
sh -c javac -classpath .:target/dependency/* -d . $(find . -type f -name '*.java')
./Main.java:5: error: class InputZahl is public, should be declared in a file named InputZahl.java
public class InputZahl {
^
./Main.java:10: error: cannot find symbol
Int zahl, ergebnis;
^
symbol: class Int
location: class InputZahl
2 errors
danke im voraus
mein skript fu8nktioniert nicht bei dem befehl "public class InputZahl {"
ganzes skript hierrbei:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class InputZahl {
public static void main(String[] args) throws IOException {
BufferedReader stdin = new BufferedReader(new InputStreamReader(
System.in));
String input;
Int zahl, ergebnis;
System.out.println("Geben Sie eine ganze Zahl ein:");
input = stdin.readLine();
zahl = Integer.parseInt(input);
ergebnis = zahl + zahl;
System.out.println("Das Ergebnis der Multiplikation von " + zahl
+ " und " + zahl + " ergibt " + ergebnis);
}
}
sh -c javac -classpath .:target/dependency/* -d . $(find . -type f -name '*.java')
./Main.java:5: error: class InputZahl is public, should be declared in a file named InputZahl.java
public class InputZahl {
^
./Main.java:10: error: cannot find symbol
Int zahl, ergebnis;
^
symbol: class Int
location: class InputZahl
2 errors
danke im voraus