Hallo,
Arbeite mit Eclipse
Ich wollte so ein bubblesort Programm code erstellen bzw. nur compilieren, aber bekomme diesen Fehler
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
void is an invalid type for the variable main
Syntax error on token "(", ; expected
Duplicate local variable args
Syntax error on token ")", ; expected
The method bubblesort(int[]) is undefined for the type jo
at jo.main(jo.java:6)
Das ist der Code
Wisst ihr woran das liegt???
Wäre euch für antworten sehr dankbar
Arbeite mit Eclipse
Ich wollte so ein bubblesort Programm code erstellen bzw. nur compilieren, aber bekomme diesen Fehler
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
void is an invalid type for the variable main
Syntax error on token "(", ; expected
Duplicate local variable args
Syntax error on token ")", ; expected
The method bubblesort(int[]) is undefined for the type jo
at jo.main(jo.java:6)
Das ist der Code
Java:
class jo
{
public static void main(String[] args)
{
public static void main(String[] args)
{
int[] unsortiert={1,5,8,2,7,4};
int[] sortiert=bubblesort(unsortiert);
for (int i = 0; i<sortiert.length; i++)
{
System.out.print(sortiert[i] + ", ");
}
}
}
}
Wisst ihr woran das liegt???
Wäre euch für antworten sehr dankbar
Zuletzt bearbeitet: