Hier werden die Unterschiede zwischen zwei Versionen gezeigt.
info:java:einrueck [2010/01/13 16:09] admin |
info:java:einrueck [2010/12/07 21:05] (aktuell) admin |
||
---|---|---|---|
Zeile 56: | Zeile 56: | ||
public static void main(String[] args){ | public static void main(String[] args){ | ||
System.out.print("Hallo "); | System.out.print("Hallo "); | ||
- | if(args.length>0) | + | if(args.length<1) |
- | System.out.println(args[0]); | + | |
- | else | + | |
System.out.println("Leute"); | System.out.println("Leute"); | ||
- | boolean hansda; | ||
- | if(args[0].equals("Hans")){ | ||
- | hansda=true; | ||
- | System.out.println("Mein Meister!"); | ||
- | } | ||
else{ | else{ | ||
- | hansda=false; | + | System.out.println(args[0]); |
- | System.out.println("Ich kenne dich nicht."); | + | if(args[0].equals("Hans")){ |
+ | System.out.println("Mein Meister!"); | ||
+ | System.out.println("Endlich bist du da."); | ||
+ | } | ||
+ | else{ | ||
+ | System.out.println("Ich kenne dich nicht."); | ||
+ | System.out.println("Geh fort!"); | ||
+ | } | ||
} | } | ||
} | } | ||
Zeile 81: | Zeile 81: | ||
public static void main(String[] args){ | public static void main(String[] args){ | ||
System.out.print("Hallo "); | System.out.print("Hallo "); | ||
- | if(args.length>0) System.out.println(args[0]); | + | if(args.length<1) System.out.println("Leute"); |
- | else System.out.println("Leute"); | + | else{ |
- | boolean hansda; | + | System.out.println(args[0]); |
- | if(args[0].equals("Hans")){ | + | if(args[0].equals("Hans")){ |
- | hansda=true; | + | System.out.println("Mein Meister!"); |
- | System.out.println("Mein Meister!"); | + | System.out.println("Endlich bist du da."); |
- | } else{ | + | } else{ |
- | hansda=false; | + | System.out.println("Ich kenne dich nicht."); |
- | System.out.println("Ich kenne dich nicht."); | + | System.out.println("Geh fort!"); |
+ | } | ||
} | } | ||
} | } |