Course of Raku / Objects, I/O, and exceptions / Classes and objects / Introspecting objects / Exercises

Count the attributes

Problem

Define a class Point with two attributes, x and y. Then print how many attributes the class has.

Example

The program prints:

2

Solution

✅ See the solution

Course navigation

← Solution: Describe a class   |   Solution: Count the attributes →