man.wife means what? If it was Man.wife then it'd have been class Man and variable wife, where this variable wife is of class Woman(as given in predefined code). What does this all mean? Also if the class is static then doesn't that mean that we should access it using class_name.(method_name/var_name) instead of using the object of it?
man.wife and Woman wife in class Man?
You must be signed in to leave a comment
2 October 2018, 03:34
When you start off in the exercise you only have a couple classes (ie. blueprints) each with a few variables/properties (ie. age, height) that don't have any values, yet (you assign them values in the main method) Thats where 'man.wife'/'woman.husband' comes in. Use this in the main method to assign them values like you would assign a value to a variable because as you can see in the Woman and Man classes the properties don't have values. REMEMBER you must create instances of these classes (inside main) first
Artem Divertitto Senior Android Developer at United Tech
23 August 2018, 10:23
man.wife this means you to use wife variable in Man class object.