Multiple choice

For networking in Java, which package needs to be imported?

  1. java.net

  2. java.socket

  3. java.networking

  4. java.serversocket

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

The java.net package provides all networking classes and interfaces in Java, including Socket, ServerSocket, URL, HttpURLConnection, and InetAddress. This package is essential for network communication and protocol handling. The other options like java.socket, java.networking, and java.serversocket don't exist as standard Java packages.