It only hints instead of explaining how to apply what's in the lesson to this task.
How do I save a reference?
Under discussion
Comments (1)
- Popular
- New
- Old
You must be signed in to leave a comment
Anthony Chalk
7 December 2019, 11:13
In Java Objects point to an area in memory where the relevant data is stored. When you name an Object, you're creating a reference by which you can access that particular area in memory.
In this instance
creates a Man (note - uppercase M) Object. The reference to this Man Object is man (lowercase m).
If now you want to access this particular Object i.e. to assign a wife to it, you would access it by using the reference "man" that you assigned to it when creating the Object +1