0
Plz help me to fix the problem below
public class Person { public static void main(String[] args) { Person p = new Person(); p.setAge(25); change(p); System.out.println (p.getAge()); } static void change(Person p) { p.setAge (10); } }
3 Antworten
+ 1
Uhhh... you don't have an age attribute, setAge function, or getAge function defined, that could be the problem. You also don't have a person constructor.
0
Thnks all for the help