"Hallo Welt" in Java

<! - Titel: "Hello World" in Java->

Einführung

Zum Lernen habe ich "Hello World" in verschiedenen Sprachen implementiert.

Java.

Umgebung

Visual Studio Code (Windows-Version)

Windows Subsystem for Linux (Ubuntu 18.04 LTS)

javac 1.8.0_181 openjdk 10.0.2 2018-07-17

Hello World

HelloWorld.java


public class HelloWorld {
    public HelloWorld(int count) {
        this.count = count;
    }

    private int count;

    private void sayOnce(Integer value) {
        System.out.println("Hello, world. " + value.toString());
    }

    public void say() {
        for (int i = 0; i < this.count; i++) {
            sayOnce(i);
        }
    }

    public static void main(String[] args) {
        HelloWorld hw = new HelloWorld(10);

        hw.say();
    }
}

Ausgabeergebnis

Hello, world. 0
Hello, world. 1
Hello, world. 2
Hello, world. 3
Hello, world. 4
Hello, world. 5
Hello, world. 6
Hello, world. 7
Hello, world. 8
Hello, world. 9

Impressionen

Ich habe es wie C ++ beendet.

Ich habe Java selbst nicht so oft berührt, aber ich benutze C # oft, damit ich es ohne Unbehagen schreiben kann.

Recommended Posts

"Hallo Welt" in Java
Hallo Welt in Java
Java, Hallo Welt!
Java Hallo Welt
Hallo Welt von Java in Eclipse jetzt
Hallo Welt in Java und Gradle
Java lernen (1) -Hallo Welt
Java-Geschichte in dieser Welt
Java Hallo Welt, kompilieren, ausführen
Zeigen Sie "Hello World" im Browser mit Java an
Zeigen Sie "Hello World" im Browser mit Java an
Java-Anfänger lesen Hello World
Frühlingsstiefel Hallo Welt in Eclipse
Hallo Welt für ImageJ Java Plugin
Hallo Welt mit AWS Lambda + Java
Hallo, Welt in Vanille Java-EHW2018 "MVP"
Partisierung in Java
Änderungen in Java 11
Janken in Java
Lesen Sie "Hallo Welt"
Hallo Java Lambda
Umfangsrate in Java
FizzBuzz in Java
Hallo Welt! Im Bootstrap Loader Bereich
Hallo Welt mit Java Template Engine Thymeleaf
[Trainieren! ] Zeigen Sie Hello World mit Spring Boot an
Java-Entwicklung mit Codenvy: Hello World! Run
"Hallo Welt!" Mit Kotlin + CLI in 5 Minuten
Hallo Welt auf Mac VSCode Java
Minimale Java-Umgebungskonstruktion und Hello World
Vergleiche Hallo Welt! Mit Spring Boot mit Java, Kotlin und Groovy
Lesen Sie JSON in Java
Interpreter-Implementierung durch Java
Machen Sie einen Blackjack mit Java
Geben Sie Hello World in der einfachen Hauptfunktion von kotlin aus
Janken App in Java
Einschränkungsprogrammierung in Java
Setzen Sie Java8 in Centos7
NVL-artiger Typ in Java
Verbinden Sie Arrays in Java
Aufrufbare Schnittstelle in Java
Hallo Welt mit JavaFX 11 (OpenJFX) von Liberica JDK 11
Kommentare in der Java-Quelle
Azure funktioniert in Java
Erstellen Sie eine Java-Umgebung und geben Sie Hallo Welt aus [Anfänger]
Lesen Sie System.out.println ("Hallo Welt")
Schreiben wir Hello World
Formatieren Sie XML in Java
Einfache HTML-Spezialchars in Java
Boyer-Moore-Implementierung in Java
Verwenden Sie OpenCV mit Java
WebApi-Memorandum mit Java
Typbestimmung in Java
Befehle in Java ausführen (Ping)
Java-Teil 1-Hallo Welt studieren
Verschiedene Threads in Java
Implementierung der Heap-Sortierung (in Java)
Zabbix API in Java
[Java] Hallo Welt mit Java 14 x Spring Boot 2.3 x JUnit 5 ~