Course of Raku / Objects, I/O, and exceptions / Classes and objects / Class methods
Quiz — Class methods
What does the following program print? The method n uses
no attributes.
class T {
method n { 42 }
}
say T.n + T.new.n;| 0 | 42 |
| 1 | 84 |
| 0 | (T) |
| 0 | an error |