Reading and understanding a simple class interface to create objects and call methods on them — exercise

Did you try it yourself yet?האם כבר ניסיתם לפתור בעצמכם?

Trying first, even if it fails, lets the exercise teach you. Show the solution now?לנסות לפני צפייה בפתרון, היא דרך טובה מאד ללמוד. האם להציג את הפתרון?