GetAllIP.java Source code

Java tutorial

Introduction

Here is the source code for GetAllIP.java

Source

import java.net.*;

public class GetAllIP {
    public static void main(String[] args) throws Exception {
        InetAddress[] addr = InetAddress.getAllByName("www.java2s.com");
        for (int i = 0; i < addr.length; i++)
            System.out.println(addr[i]);
    }
}