VSIP/formularium: verschil tussen versies
Naar navigatie springen
Naar zoeken springen
Regel 10: | Regel 10: | ||
if loop | if loop | ||
if cond then C1 else C2 end | if cond then C1 else C2 end | ||
class | |||
MAIN -- de naam van je klasse | |||
creation | |||
constructormethod -- constructoren aanduiden | |||
feature{} -- private other: feature{ANY}, feature{NAMECLASS} | |||
constructormethod is | |||
do | |||
io.put_string("hello world") --do stuff | |||
end -- make | |||
end -- class MAIN | |||
=C++= | =C++= |
Versie van 10 dec 2008 10:54
Schrijf hier korte voorbeeldjes neer voor elke taal
Smalltalk
Eiffel
niet gelijk aan : \= null: Void
if loop
if cond then C1 else C2 end
class MAIN -- de naam van je klasse creation constructormethod -- constructoren aanduiden feature{} -- private other: feature{ANY}, feature{NAMECLASS} constructormethod is do io.put_string("hello world") --do stuff end -- make end -- class MAIN
C++
C#
Getters en setters:
- Mogelijkheid 1
private string foo; public string Foo { get { return foo; } set { foo = value; } }
- Mogelijkheid 2 (C# 3.0+)
public string Foo { get; set; }