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.
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