Change your main to:
public static void main(String[] args) {
EchoServer echoServer = new EchoServer();
echoServer.listen();
}
When you declare Object EchoServer0;
you have a few mistakes.
- EchoServer0 is of type Object, therefore it doesn’t have the method listen().
- You will also need to create an instance of it with
new
. - Another problem, this is only regarding naming conventions, you should call your variables starting by lower case letters, echoServer0 instead of EchoServer0. Uppercase names are usually for class names.
- You should not create a variable with the same name as its class. It is confusing.