Online Java Compiler By
JavaTpoint.com
import java.io.IOException; import java.net.*; public class JavaSocketGetReceiveBufferSizeExample2 { public static void main(String[] args) throws IOException { //calling the constructor of the socket class Socket socket = new Socket(); //getReceiveBufferSize() method returns the buffer size set for this socket // by default the buffer size of this socket is set to 65536 System.out.println("Buffer size: "+socket.getReceiveBufferSize()); } }
Output