Hello World
C#
・メインクラス
using System; namespace Prj入門_Console { class Program { /// <summary> /// /// </summary> /// <param name="args"></param> static void Main(string[] args) { // 文字列表示 Console.WriteLine("Hello World!"); // クラス インスタンス化1 var Cls_HelloWorld = new No01_HelloWorld.Cls_HelloWorld(); Cls_HelloWorld.HelloWorld(); // クラス インスタンス化2 (new No01_HelloWorld.Cls_HelloWorld()).HelloWorld(); // 静的クラス No01_HelloWorld.Cls_HelloWorld.HelloWorld_static(); } } }
・クラス
using System; using System.Collections.Generic; using System.Text; namespace Prj入門_Console.No01_HelloWorld { class Cls_HelloWorld { /// <summary> /// 動的クラス /// </summary> public void HelloWorld() { Console.WriteLine("Hello World."); } /// <summary> /// 静的クラス /// </summary> public static void HelloWorld_static() { Console.WriteLine("Hello World(static)."); } } }
C++
std::cout << "Hello World!\n"; printf("Hello World!\n");
python
print('Hello World');
javascript
<!DOCTYPE html> <html> <head> <title>サンプル</title> </head> <body> <script> document.write("Hello world!!"); </script> </body> </html>
R
print("Hello World")