Last active
August 29, 2015 14:09
-
-
Save TPei/889799e1196c0f52cceb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Methoden { | |
public static void main(String[] args){ | |
// da kein return Wert, brauchen wir auch nichts speichern | |
ausgeben("Hallo Ausgabe"); | |
// da keine Argumente erwartet, uebergeben wir auch keine | |
int zahl = gibDrei(); | |
System.out.println(zahl); | |
} | |
// neue Methoden | |
// public static rückgabeTyp name(Datentyp argument, Datentyp argument2, ...) | |
// kein wiedergabewert, erhaelt text zur ausgabe | |
public static void ausgeben(String text){ | |
System.out.println(text); | |
} | |
// gibt int zurueck, erwartet kein Argument | |
public static int gibDrei(){ | |
return 3; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment