Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0

public class TestSample {
    public static void main(String[] args) {
        System.out.print("Hi, ");
        System.out.print(args[0]);
        System.out.println(". How are you?");
    }
}

Wenn ich kompilieren Sie dieses Programm, ich bekomme diese Fehlermeldung:

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0


Auch, warum kann ich nicht eine args akzeptiert ein int-array wie dieses:

public static void main(int[] args) {
InformationsquelleAutor John Cooper | 2011-09-12
Schreibe einen Kommentar