[JAVA] [Programming learning] Logic comparison by language part.1 ("Hello World")

Since I started learning various languages in parallel on a certain programming learning site, I will summarize what kind of code each will be and how it will be different when trying to obtain the same output in each language as the output of the learning content. I will go.

1."Hello World." Display "Hello World." Stored in variable message

Ruby

helloworld.rb


message = "Hello World."
puts message
$ ruby helloworld.rb
Hello World.

Python3

helloworld.py


message = "Hello World."
print(message)
$ python helloworld.py
Hello World.

Swift

helloworld.swift


var message = "Hello World."
print(message)
(playground)
Hello World.

Java

helloworld.java


public class helloworld {
	public static void main(String[] args){
		 System.out.println("Hello World.");
	}
}
(eclipse console)
Hello World.

C#

helloworld.cs



using System;
public class Hello{
    public static void Main(){
        Console.WriteLine("Hello World.");
    }
}

(Assumption that the exe file is created by compiling Execute using'mono'in the execution environment at hand)

$ mono helloworld.exe
Hello World.

Reference articles, etc.

About C # execution environment preparation on mac Compile and run C # code on Mac

About java development / execution environment preparation on mac [Mac] How to easily install Java development environment all at once

Recommended Posts

[Programming learning] Logic comparison by language part.1 ("Hello World")
[Programming learning] Logic comparison by language part.3 (conditional branching)
[Programming learning] Logic comparison by language part.2 (variables: numbers, character strings)
Programming language in "Hello World"
Hello World in GO language
[2019 latest version] Programming language comparison
Making sound by programming Part 2
Stack processing speed comparison by language
Hello World! By QPython with Braincrash
Introduction to Ansible Part 1'Hello World !!'
C language to see and remember Part 1 Call C language from Python (hello world)
Hello World! By QPython with Brainfu * k
Learn math and English by programming (Part 2)
Hello world
Classification of guitar images by machine learning Part 1
Hello world with full features of Go language
Video frame interpolation by deep learning Part1 [Python]
Classification of guitar images by machine learning Part 2