Solved

Which Code Creates a Server Socket on Port PORT_NUMBER and Listens

Question 24

Multiple Choice

Which code creates a server socket on port PORT_NUMBER and listens for a connection?


A) ServerSocket ss = new ServerSocket(PORT_NUMBER) ;
Socket sock = ss.accept() ;
B) Socket ss = new Server(PORT_NUMBER) ;
ServerSocket sock = ss.accept() ;
C) ServerSocket ss = new ServerSocket() ;
Socket sock = ss.accept() ;
D) ServerSocket ss = new ServerSocket(PORT_NUMBER) ;
Socket sock = new Socket(ss.accept() ) ;

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents