This file contains 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
FROM ubuntu | |
MAINTAINER heckenmann.de | |
# docker build -t heckenmann/wildfly . | |
# docker run -d -p 0.0.0.0:80:8080 -p 0.0.0.0:9990:9990 --name wildfly heckenmann/wildfly | |
# | |
# Oracle JDK 8 | |
# | |
ENV JDKPACKAGE=jdk-8u65-linux-x64.tar.gz | |
ENV JDKFOLDER=jdk1.8.0_65 |
This file contains 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
package de.heckenmann.fileaccess; | |
/** | |
* http://heckenmann.de/dateien-schreiben-und-lesen/ | |
**/ | |
public class FileAccessTest { | |
public static final String FILENAME = "./test.txt"; | |
/** |
This file contains 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
package de.heckenmann.threadbeispiel; | |
public class ThreadBeispiel implements Runnable { | |
public static void main(final String... args) throws InterruptedException { | |
// Neue Threads definieren. Es wird ein Runnable-Objekt übergeben. | |
final Thread t1 = new Thread(new ThreadBeispiel()); | |
final Thread t2 = new Thread(new ThreadBeispiel()); | |
// Threads starten |
This file contains 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 WhileSchleife { | |
public static void main(String... args) { | |
int start = 0; // Start der Zählung festlegen | |
int ende = 15; // Ende festlegen | |
while(start <= ende){ | |
System.out.println(start); // Momentanen Wert ausgeben | |
start++; // Momentanen Wert erhöhen | |
} | |
} |
This file contains 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 ForSchleife { | |
public static void main(String... args) { | |
for(int start = 0, ende = 15; start <= ende; start++){ | |
System.out.println(start); | |
} | |
int ende = 15; | |
for(int start = 0; start <= ende; start++){ | |
System.out.println(start); |
This file contains 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 DoWhile { | |
public static void main(String... args) { | |
int start = 0; | |
int ende = 15; | |
do { | |
System.out.println(start); | |
start++; | |
} | |
while(start <= ende); |
This file contains 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 HelloWorld{ | |
public static void main(String[] args){ | |
System.out.println("Hello World!"); | |
} | |
} |
This file contains 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
class AckermannFunktion { | |
public static void main(String[] args) { | |
int n = args.length > 0 ? Integer.parseInt(args[0]) : 1; | |
System.out.println(ack(n,n)); | |
} | |
// Hier beginnt die eigentliche Funktion | |
public static int ack(int n, int m){ | |
if (n == 0) { | |
return m + 1; |
This file contains 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
class Rekursion { | |
public static void main(String[] args) { | |
int start = -5; // Von diesem Wert an wird gezählt | |
int ende = 5; // Bis zu diesem Wert wird gezählt; Muss größer gleich "start" sein! | |
count(start, ende); | |
} | |
// Rekursive Definition der Methode count(..) | |
public static void count(int momentanerWert, int ende){ | |
System.out.println(momentanerWert); // Momentaner Wert wird ausgegeben |
This file contains 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
class WechselRekursion { | |
public static void main(String[] args) { | |
methode1(0, 5); | |
} | |
// Diese Methode erhöht den Wert der Variablen "momentanerWert" um 2 | |
public static void methode1(int momentanerWert, int ende){ | |
System.out.println(momentanerWert); // Ausgabe des Wertes der Variablen "momentanerWert" | |
// Rekursionsanker |
NewerOlder