GeeCON Prague 2014*
The moose likes Sockets and Internet Protocols and the fly likes compilation error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "compilation error" Watch "compilation error" New topic
Author

compilation error

puja dayal
Ranch Hand

Joined: May 27, 2013
Posts: 65




i am getting a compilation error here ' unreachable statement serversocket.close()'
Ganesh Malaichamy
Greenhorn

Joined: Feb 11, 2011
Posts: 27
Watch out for the line System.exit(-1). Whenever the exception occurs the last line will not get executed because of this System.exit.
Sachin H. Gupta
Greenhorn

Joined: Oct 10, 2012
Posts: 17
The code is reachable but it must be enclosed in the try-catch block as it throws an IOExcpetion
 
GeeCON Prague 2014
 
subject: compilation error