Although I have not changed anything from the original, I just don't get it. It doesn't make sense to my little brain. Like, I mean, how does this work!? I don't see a problem here, yet, its wrong. Please help. I think once I understand this, I will understand the next one aswell (not sure) but you know. I just need a teacher xD
package com.codegym.task.task04.task0401;
/*
This age doesn't work for me…
*/
public class Solution {
public static void main(String[] args) {
Person person = new Person();
System.out.println("Age is: " + person.age);
person.adjustAge(person.age);
System.out.println("Adjusted age is: " + person.age);
}
public static class Person {
public int age = 20;
public void adjustAge(int age) {
age = age + 20;
System.out.println("Age in adjustAge() is: " + age);
}
}
}