Xiii. Develop A Program Using Inetaddress Class To Retrive Ip Address of Computer When Hostname Is Entered by The User

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

XIII.

Develop A Program Using InetAddress Class To Retrive IP Address Of Computer When


Hostname Is Entered By The User.

import java.net.*;

import java.util.*;

public class Practical_14

public static void main(String [] args)

try

InetAddress ip=InetAddress.getByName("www.facebook.com");

System.out.println("Host Name: "+ip.getHostName());

System.out.println("IP Address: "+ip.getHostAddress());

catch(Exception e)

System.out.println(e);

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy