Why can't you access the properties of an object in the method of spark: scala?

clipboard.png

how to understand the content of the green part? Why does it feel so awkward? the feeling in the book is also very vague.

Feb.28,2021
The parameters passed in the

Rational class are accessible in the add method.
if add is defined in this way, there is no problem.
but add passes in a rational object. In add, the parameter that is the Rational class.
while the Rational class does not have n and d attributes, so it cannot be accessed.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b35a3c-2bfc4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b35a3c-2bfc4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?