1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

【プログラミング学習】 言語別ロジック比較 part.1("Hello World")

1
Last updated at Posted at 2019-08-16

某プログラミング学習サイトでいろんな言語を並行して学習し始めたので、学習内容のアウトプットとして、各言語で同じ出力を得ようとした時に、それぞれどんなコードになって、どう違ってくるのかをまとめていこうと思います。

1."Hello World."

変数messageに格納された"Hello World."を表示

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.");
    }
}

(コンパイルしてexeファイルはできてる前提
手元の実行環境では'mono'を使って実行)

$ mono helloworld.exe
Hello World.

参考記事等

macでのC#の実行環境準備について
MacでC#のコードをコンパイルして実行する

macでのjava開発・実行環境準備について
【Mac編】Javaの開発環境を簡単に一括インストールする方法

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?