Java classes throwing a permanent error

I wrote the code and when I run it, there is always an error in different parts. At the moment, I encountered an error with the Player element, it is highlighted in red all the time:

public class GuessGame { Player p1; Player p2; Player p3; public void startGame(){ p1 = new Player(); p2 = new Player(); p3 = new Player(); } }

I do not understand what the problem is and how to avoid such errors, what affects them? And what other services are there for code analysis? I want to check it in the process, and not see its errors at startup.

So where did you declare your class player ?

1 Like


This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.