0

Why error

https://code.sololearn.com/cxqoD3xWuMaS/?ref=app error: unreported exception IOException; must be caught or declared to be thrown serverSocket = new ServerSocket(port); ^ storage/shared/Download/Jvdroid/PROJ/server.java:23: error: unreported exception IOException; must be caught or declared to be thrown clientSocket = serverSocket.accept(); ^ storage/shared/Download/Jvdroid/PROJ/server.java:24: error: unreported exception IOException; must be caught or declared to be thrown out = new PrintWriter(clientSocket.getOutputStream(), true); ^ storage/shared/Download/Jvdroid/PROJ/server.java:25: error: unreported exception IOException; must be caught or declared to be thrown in = new BufferedReader(new InputStreamReader(clientSocket.getInputStream())); ^ storage/shared/Download/Jvdroi

18th Jan 2023, 3:06 PM
Jables
Jables - avatar
1 Answer
+ 1
Method will throw exception not class Class can extend another class Class can implement multiple interfaces Exception must be handled inside try catch block https://code.sololearn.com/cY5YVbQ2Qtgk/?ref=app
18th Jan 2023, 3:32 PM
AÍąJ
AÍąJ - avatar