First page Back Continue Last page Overview Graphics
Perl 6: OOP
class Point::3D is Point {
has $:z = 0.0;
method clear() { $:z = 0; next; }
method move_up() { $:z++; }
method move_down() { $:z--; }
}
Notes:
Encapsulation, finalmente! Attributi e metodi “nascosti” con i due punti