[Solved] The static method…should be accessed in a static way [closed]


You are calling your methods correctly (from logical point of view)
but apparently you have declared them incorrectly (as static).
Make them instance methods by removing the static modifier.
That should fix your problem. And learn the the difference between
static and instance methods (seems you haven’t quite yet).

In particular getName and setName should not be static.

3

solved The static method…should be accessed in a static way [closed]