dimanche 13 novembre 2016

Nullstring als Eingabe

dimanche 13 novembre 2016
Hey, wenn ich bei Java bei der Ausführung des Programms per Kommandozeile die Eingabe leer lasse kommt die Fehlermeldung (arrayindexoutofboundsexception) ,obwohl das doch das selbe ist als wenn ich "" statt args[0] mit einer Nullzeile dastehen hab. Wie könnte man verhindern das diese Fehlermeldung kommt und stattdessen im input string "" ist. Als Beispiel wo der Fehler kommt:
Code (Java):
public class test {
    public static void main(String... args) {
        String input = args[0];...


Nullstring als Eingabe

Nullstring als Eingabe

0 commentaires:

Enregistrer un commentaire

 
◄Design by Pocket