Online Java Compiler By
JavaTpoint.com
import java.io.IOException; import java.net.*; public class JavaSocketIsBoundExample2 { public static void main(String[] args) throws IOException { //calling the constructor of the socket class Socket socket = new Socket(); //isBound() method returns a boolean value if the socket is bounded //by default the isBound() method returns false System.out.println("The Socket is bounded: "+socket.isBound()); } }
Output