Header Ads

  • Breaking Now

    How will you get an IP address of a machine from its hostname?

    The following code snippet gives you the IP address on the basis of Hostname:

    InetAddress inetAddress = InetAddress.getByName("www.interviewjava.blogspot.com");
    System.out.println ("IP  Address: " + inetAddress.getHostAddress());
    

    No comments

    Post Top Ad

    Post Bottom Ad