Hello world

Java

public class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello, world!");
    }
}

JavaScript

To write to a console or debugging log:

console.log('Hello, world!');

To display an alert dialog box:

alert('Hello, world!');

To write to an HTML document:

document.write('Hello, world!');
 

C#

In a console or terminal:

using System;
class Program
{
    public static void Main(string[] args)
    {
        Console.WriteLine("Hello, world!");
    }
}

Via a GUI message box:

using System.Windows.Forms;
class Program
{
    public static void Main(string[] args)
    {
        MessageBox.Show("Hello, world!");
    }
}

HTML

<!DOCTYPE html>
<html>
   <head></head>
   <body>
       <p>Hello, world!</p>
   </body>
</html>

SQL

SELECT 'Hello, world!' FROM DUMMY; -- DUMMY is a standard table in SAP HANA.
SELECT 'Hello, world!' FROM DUAL; -- DUAL is a standard table in Oracle.
SELECT 'Hello, world!'; -- Works for SQL Server, Microsoft Access, PostgreSQL, SQLite, and MySQL.

 

PL/SQL

SET SERVEROUTPUT ON;
BEGIN
    DBMS_OUTPUT.PUT_LINE('Hello, world!');
END;

Visual Basic .NET

In a console or terminal window:

Module Module1
    Sub Main()
        Console.WriteLine("Hello, world!")
    End Sub
End Module

In a message box:

Module Module1
    Sub Main()
         MsgBox("Hello, world!")
    End Sub
End Module

examples Reference Url:http://en.wikipedia.org/wiki/List_of_Hello_world_program_examples

 
原文地址:https://www.cnblogs.com/sealovesky99/p/4394980.html