首页 > 其他 > 详细

Hello world

时间:2015-04-05 23:22:31      阅读:254      评论:0      收藏:0      [点我收藏+]

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

 

Hello world

原文:http://www.cnblogs.com/sealovesky99/p/4394980.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!