Online Java Compiler By
JavaTpoint.com
import java.io.IOException; import java.net.MulticastSocket; public class JavaMulticastSocketgetTTLExample_2 { public static void main(String[] args) throws IOException { MulticastSocket ms1 = new MulticastSocket(); //setTTL() method ms1.setTTL((byte) 30); System.out.println("TTL : " + ms1.getTTL()); } }
Output