why do we create the "man.wife = woman" variable? How is this used..??
I passed the task but I don't know what I'm doing.
Under discussion
Comments (1)
- Popular
- New
- Old
You must be signed in to leave a comment
Guadalupe Gagnon
8 December 2021, 14:30
man.wife is not a created variable. The dot operator (as in man dot wife) allows you to access members of the created object, in this case the wife variable that is part of the man object as defined in the class. You are setting this variable to the woman object created above.
**members of a class are all the variables and methods that a class defines. You can access any of them with the dot operator as long as the permission allows, which is an advanced topic that I wont elaborate on now.
+1