跳到主要内容

Classes

What is a class?

A class is a way of organizing methods and variables within a certain object

How to define a class

class yourClassName = 
{
...
}

Usage Examples

class mathClass = {
func add(val_one, val_two) = {
return val_one + val_two
}

};

func main() = {
math = new mathClass();
print(math.add(2,6))
}

OUTPUT:

8