I’m so new to Java and I cant find what im doing wrong.
I got a error once that said GetAd() isnt undefined for the type Test, but it is public, i dont understand.
here is the codecode:
>Solution :
You are not updating the instance variable ad in your SetAd() method and hence when you call GetAd() it returns the default null value.
Replace name = ad; in your SetAd() method to ad = name;; In other words, do not update the local variable of the method but rather update the instance variable.