|
大小: 381
备注:
|
大小: 2954
备注:
|
| 删除的内容标记成这样。 | 加入的内容标记成这样。 |
| 行号 1: | 行号 1: |
| ## page was renamed from 各种语言的HelloWorld程序 <<TableOfContents>> ||语言||编译类型||类型|| ||C||编译||静态强类型|| ||C++||编译||静态强类型|| ||Python||解释||动态强类型|| ||Lisp||解释||?|| ||Delphi||编译||?|| ||Perl||解释||?|| ||VB||?||?|| ||Java||编译解释||静态强类型|| ||JavaScript||解释||?|| ||TCL||?||?|| ||SmallTalk||?||?|| == C == * 详见[[C|C语言]] == C++ == {{{#!cplusplus #include <iostream> #include <string> using namespace std; class Message { private: string txt; public: Message(string s){ txt = s;} void Print() const { cout << txt;} }; int main() { Message M("Hello world"); M.Print(); } }}} 详见[[C++]]语言 == Python == 详见[[Python]]语言 == Lisp == * XLISP: http://www.mv.com/ipusers/xlisper/ * XLISP PLUS: http://almy.us/xlisp.html |
|
| 行号 30: | 行号 79: |
一个Delphi教程:[[attachment:delphitut.zip]] == Perl == {{{ package Message; # Message class constructor sub new { my $class = shift; my $txt = shift; my $self = {}; $self->{txt} = $txt; bless ($self, $class); return $self; } #Message->print() method sub print{ my $self = shift; if ($self->{txt} eq ""){ print "No message"; }else{ for($i=0;$i<3;$i++){ print $self->{txt},"\n"; } } return $self } 1; }}} {{{ require Message; $m = Message->new("Hello World"); $m->print(); }}} * Robert's Tutorial: http://perl.sioc.org/win32perltut.html == Visual BASIC == {{{ class Message Private theTxt Public Property Let TXT(S) theTxt = S End Property Public Sub Print() Wscript.echo theTxt End Sub End Class Dim M set M = new Message M.TXT = "Hello world" m.Print() }}} * VB教程: [[attachment:vb_site.zip]] == Java == {{{ class Msg{ private String txt; public Msg(String s){ txt = s; } public void print(){ System.out.println(txt); } } public class hello{ public static void main(String args[]){ Msg M = new Msg("hello world"); M.print(); int i = 0; } } }}} 一个简洁的Java教程:[[attachment:Java Programming for beginners in fourhours.htm]] == JavaScript == 一个Java Script教程:[[attachment:jsintro.zip]] == Smalltalk == * Dolphin Smalltalk: http://www.object-arts.com/content/navigation/products/dce.html 文档:http://www.object-arts.com/docs/index.html [[attachment:DolphinEducation.exe]] == Tcl == * http://www.noucorp.com/ |
语言 |
编译类型 |
类型 |
C |
编译 |
静态强类型 |
C++ |
编译 |
静态强类型 |
Python |
解释 |
动态强类型 |
Lisp |
解释 |
? |
Delphi |
编译 |
? |
Perl |
解释 |
? |
VB |
? |
? |
Java |
编译解释 |
静态强类型 |
解释 |
? |
|
TCL |
? |
? |
? |
? |
C
详见C语言
C++
详见C++语言
Python
详见Python语言
Lisp
XLISP PLUS: http://almy.us/xlisp.html
Delphi
program hellopas;
{$APPTYPE CONSOLE}
uses windows;
type Message = class
txt : string;
constructor create(s:string);
procedure print;
end;
constructor Message.Create(s:string);
begin
txt := s
end;
procedure Message.print;
begin
writeln(txt)
end;
var m : Message;
begin
m := Message.Create('Hello world');
m.print()
end.一个Delphi教程:delphitut.zip
Perl
package Message;
# Message class constructor
sub new {
my $class = shift;
my $txt = shift;
my $self = {};
$self->{txt} = $txt;
bless ($self, $class);
return $self;
}
#Message->print() method
sub print{
my $self = shift;
if ($self->{txt} eq ""){
print "No message";
}else{
for($i=0;$i<3;$i++){
print $self->{txt},"\n";
}
}
return $self
}
1;require Message;
$m = Message->new("Hello World");
$m->print();Robert's Tutorial: http://perl.sioc.org/win32perltut.html
Visual BASIC
class Message
Private theTxt
Public Property Let TXT(S)
theTxt = S
End Property
Public Sub Print()
Wscript.echo theTxt
End Sub
End Class
Dim M
set M = new Message
M.TXT = "Hello world"
m.Print()VB教程: vb_site.zip
Java
class Msg{
private String txt;
public Msg(String s){
txt = s;
}
public void print(){
System.out.println(txt);
}
}
public class hello{
public static void main(String args[]){
Msg M = new Msg("hello world");
M.print();
int i = 0;
}
}一个简洁的Java教程:Java Programming for beginners in fourhours.htm
JavaScript
一个Java Script教程:jsintro.zip
Smalltalk
Dolphin Smalltalk: http://www.object-arts.com/content/navigation/products/dce.html 文档:http://www.object-arts.com/docs/index.html DolphinEducation.exe