Changes

Jump to: navigation, search

GPU621/The Chapel Programming Language

34 bytes removed, 13:42, 20 November 2020
Classes:
==== Classes: ====
A class is a type of collection that collects ''variables'', ''procedures'' and ''iterators''. We use '''class''' keyword to declare a new class typeand use '''new''' keyword to create its instace.
class myClass {
}
}
 
The '''new''' keyword creates an instance of a class by calling an initializer.
 
var foo = new myClass(0, 1);
foo.print();
25
edits

Navigation menu