Warning: preg_replace() [function.preg-replace]: The /e modifier is no longer supported, use preg_replace_callback instead in /users/mphinfo/www/inc/auth.php on line 670

Warning: preg_replace() [function.preg-replace]: The /e modifier is no longer supported, use preg_replace_callback instead in /users/mphinfo/www/inc/auth.php on line 670

Warning: preg_replace() [function.preg-replace]: The /e modifier is no longer supported, use preg_replace_callback instead in /users/mphinfo/www/inc/auth.php on line 670

Warning: preg_replace() [function.preg-replace]: The /e modifier is no longer supported, use preg_replace_callback instead in /users/mphinfo/www/inc/auth.php on line 670

Warning: Cannot modify header information - headers already sent by (output started at /users/mphinfo/www/inc/auth.php:670) in /users/mphinfo/www/inc/actions.php on line 203

Warning: Cannot modify header information - headers already sent by (output started at /users/mphinfo/www/inc/auth.php:670) in /users/mphinfo/www/lib/tpl/dokuwiki/main.php on line 12
info:java:einrueck [M/Ph/Info (Beslmeisl)]

Benutzer-Werkzeuge

Webseiten-Werkzeuge


info:java:einrueck

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen gezeigt.

Link zu dieser Vergleichsansicht

info:java:einrueck [2010/01/13 16:06]
admin
info:java:einrueck [2010/12/07 21:05] (aktuell)
admin
Zeile 20: Zeile 20:
 } }
 </​code>​ </​code>​
 +
  
  
Zeile 44: Zeile 45:
 gehezu(bett);​ gehezu(bett);​
 </​code>​ </​code>​
-Mit den geschweiften Klammern ist aus den beiden ''​iss(...)''​ ein Block geworden, was einem einzigen Befehl entspricht.+Mit den geschweiften Klammern ist aus den beiden ''​iss(...)''​ ein Block geworden, was einem einzigen Befehl entspricht. Passen Sie immer auf, dass die Klammern stimmen, damit das Programm richtig funktioniert und dass die Einrückungen stimmen, damit man als Mensch gleich sieht, wie es gemeint ist.
  
 ====if-else Langversion==== ====if-else Langversion====
Zeile 55: 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 80: 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!"​);​ 
 +      }
     }     }
   }   }

Warning: preg_replace() [function.preg-replace]: The /e modifier is no longer supported, use preg_replace_callback instead in /users/mphinfo/www/inc/auth.php on line 670
info/java/einrueck.1263395206.txt.gz · Zuletzt geändert: 2010/01/13 17:06 (Externe Bearbeitung)