Hi guys,
in the adjustAge method you need to think about what type of variable you are working with:
if it's a static variable, I.e. it belongs to the CLASS of person - then it should be declared as static
if it's an instance variable, i.e. it only belongs to this instance of the person class (the OBJECT and not the class) - you need to make this clear by using 'this.'
Hope that helps!
hint for everyone who is struggling
Under discussion
Comments (5)
- Popular
- New
- Old
You must be signed in to leave a comment
Thi Java Developer
21 February, 18:46
Thank you!
0
Pluton I
2 November 2021, 18:48
thanks, that really helps!
0
Anonymous #10760236
26 July 2021, 17:52
this was very helpful, thank you!
0
Nathan Guidry
11 May 2021, 18:19
what if there were two objects referring to the age variable
0
Nelly
27 March 2020, 09:19
Thanks bro <3 I was struggling with this task and I just solved it now.
+1