Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,27 @@
class MyClass
{
// an instance variable
Int x
// a constructor, providing default value for instance variable
new make (Int x := 1)
{
this.x = x
}
// a method, return double the number x
public Int double ()
{
return 2 * x
}
}
class Main
{
public static Void main ()
{
a := MyClass (2) // instantiates the class, with x = 2
b := MyClass() // instantiates the class, x defaults to 1
c := MyClass { x = 3 } // instantiates the class, sets x to 3
}
}