fn main() {
println!("Hello, Rust!");
}
println!("Hello, Rust!");
}
2.Go
package main
import (
"fmt"
)
func main() {
fmt.Println("Hello,World!");
}
import (
"fmt"
)
func main() {
fmt.Println("Hello,World!");
}
3.Node.js/Io.js
console.log("Hello,World!");
var http = require('http');
http.createServer(function handler(req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
}).listen(1337, '127.0.0.1');
console.log('Server running at http://127.0.0.1:1337/');
http.createServer(function handler(req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
}).listen(1337, '127.0.0.1');
console.log('Server running at http://127.0.0.1:1337/');
4.Groovy
package com.mavsplus.groovy.example.helloworld
/**
* Groovy第一個例子 "Hello World!"
*
* @author landon
* @since 1.8.0_25
*/
class HelloWorld {
static void main(args) {
println "Hello,World!"
}
}
/**
* Groovy第一個例子 "Hello World!"
*
* @author landon
* @since 1.8.0_25
*/
class HelloWorld {
static void main(args) {
println "Hello,World!"
}
}
5.Scala
package com.mavsplus.scala.example.helloworld
/**
* 第一個Scala程序 "Hello World!"
*/
object HelloWorld {
def main(args: Array[String]) {
println("Hello,World!")
}
}
/**
* 第一個Scala程序 "Hello World!"
*/
object HelloWorld {
def main(args: Array[String]) {
println("Hello,World!")
}
}
6.Lua
local function main()
print("Hello,World!")
end
main()
print("Hello,World!")
end
main()