[Solved] How to call an Object Method in Java


public class newCharacters
{
   Character person1 = new Character(2, 4, 3);
   person1.getStat("atk");
}

This should not be in a class. This does not mean anything. A class can have bunch of instance variables and methods.

Please study the basics well 😉

Put it in a main method inside the Character class

public static void main(String [] args) {
   Character person1 = new Character(2, 4, 3);
   person1.getStat("atk");
}

1

solved How to call an Object Method in Java