The code snippet below is from Schildt (Java full guide, p. 680).
import java.net.*; import java.util.Objects; class InetAddressTest { public static void main(String args[]) throws UnknownHostException { InetAddress Address = InetAddress.getLocalHost(); System.out.println(Address); Address = InetAddress.getByName("www.lurkmore.to"); System.out.println(Address); InetAddress SW[] = InetAddress.getAllByName("vedomosti.ru"); for (int i=0; i<SW.length; i ++) System.out.println(SW[i]); } } There is a boolean isMulticastAddress() method in the InetAddress class. It returns true if the address is a group address.
Colleagues, please tell me, how can I write this method into the source code to check whether the Internet address is a group address? And then I enter this way and that, and it does not work out.
