Permanent error in class Java

I wrote the code and when I run it, all the time there is an error in different parts. I’m currently running into an error here:

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.

1 Like

#1: Perhaps you could illuminate us on what error you’re getting?
#2: This isn’t Javascript. This is Java. Java is to Javascript as Pen is to Penguin.

Thread moved to somewhere more appropriate.

2 Likes

All the time it is displayed in red and writes an error on the Player

Have you defined the Player class somewhere?

Yes, I`m defined “Player” class

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