Hallo.
ich hab ein java Schleifen Programm Programmiert. Also nix großartiges. Aber da erscheint folgende Fehlermeldung:
while.java:12: illegal start of expression
public static void main( String[] args ) {
^
while.java:12: illegal start of expression
public static void main( String[] args ) {
^
while.java:12: ';' expected
public static void main( String[] args ) {
^
while.java:12: '.class' expected
public static void main( String[] args ) {
^
while.java:12: ';' expected
public static void main( String[] args ) {
^
5 errors
Ich versteh nicht so, wieso das nicht funktioniert.
lg
ich hab ein java Schleifen Programm Programmiert. Also nix großartiges. Aber da erscheint folgende Fehlermeldung:
while.java:12: illegal start of expression
public static void main( String[] args ) {
^
while.java:12: illegal start of expression
public static void main( String[] args ) {
^
while.java:12: ';' expected
public static void main( String[] args ) {
^
while.java:12: '.class' expected
public static void main( String[] args ) {
^
while.java:12: ';' expected
public static void main( String[] args ) {
^
5 errors
Code:
class Schleife{
int i = 12;
void schleifenlauf(int i){
while (i > 0 ){
System.out.println(i);
i--; // i dekrementieren
}
public static void main( String[] args ) {
Schleife p = new Schleife(); // referenzvariable erstellen
p.schleifenlauf(); // methode aufrufen
}
}
Ich versteh nicht so, wieso das nicht funktioniert.
lg