版本19和20间的区别
于2007-05-20 14:01:13修订的的版本19
大小: 2622
编辑: czk
备注:
于2008-02-23 15:34:17修订的的版本20
大小: 2630
编辑: localhost
备注: converted to 1.6 markup
删除的内容标记成这样。 加入的内容标记成这样。
行号 2: 行号 2:
[[TableOfContents]] <<TableOfContents>>
行号 5: 行号 5:
 * 详见["C语言"]  * 详见[[C语言]]
行号 28: 行号 28:
详见["C++语言"] 详见[[C++语言]]
行号 31: 行号 31:
详见["Python语言"] 详见[[Python语言]]
行号 67: 行号 67:
一个Delphi教程:attachment:delphitut.zip 一个Delphi教程:[[attachment:delphitut.zip]]
行号 128: 行号 128:
 * VB教程: attachment:vb_site.zip  * VB教程: [[attachment:vb_site.zip]]
行号 150: 行号 150:
一个简洁的Java教程:[attachment:Java%20Programming%20for%20beginners%20in%20fourhours.htm] 一个简洁的Java教程:[[attachment:Java Programming for beginners in fourhours.htm]]
行号 153: 行号 153:
一个Java Script教程:attachment:jsintro.zip 一个Java Script教程:[[attachment:jsintro.zip]]
行号 156: 行号 156:
 * Dolphin Smalltalk: http://www.object-arts.com/content/navigation/products/dce.html 文档:http://www.object-arts.com/docs/index.html attachment:DolphinEducation.exe  * Dolphin Smalltalk: http://www.object-arts.com/content/navigation/products/dce.html 文档:http://www.object-arts.com/docs/index.html [[attachment:DolphinEducation.exe]]

C

C++

   1 #include <iostream>
   2 #include <string>
   3 using namespace std;
   4 
   5 class Message {
   6 private:
   7    string txt;
   8 public:
   9    Message(string s){ txt = s;}
  10    void Print() const { cout << txt;}
  11 };
  12 
  13 int main()
  14 { 
  15    Message M("Hello world");
  16    M.Print();
  17 }

详见C++语言

Python

详见Python语言

Lisp

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();

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()

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

Tcl

程序设计语言 (2020-04-26 08:51:16由czk编辑)

ch3n2k.com | Copyright (c) 2004-2020 czk.