Paul Clapham wrote:Let's start at the beginning: how can you tell it isn't working?
When I try to run one of these files, an error appears:
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
The method main cannot be declared static; static methods can only be declared in a static or top level type
at server.SimpleChatServer$ClientHandler.main(SimpleChatServer.java:40)
That message says that your "public static void main" method shouldn't be inside that nested class. Move it out of there so that it's a method of SimpleChatServer.
Paul Clapham wrote:That message says that your "public static void main" method shouldn't be inside that nested class. Move it out of there so that it's a method of SimpleChatServer.
Thank you :thumbup:
The only taste of success some people get is to take a bite out of you. Or this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss