Welcome to the World of Programming

Welcome to the World of Programming

Search this blog

Finding IP Address of Ur System

import java.util.*;
import java.lang.*;
import java.net.*;

public class OwnIP{
    public static void main(String args[]){
        try{
            InetAddress ownIP=InetAddress.getLocalHost();
            System.out.println("IP Address of this Computer :"+ownIP.getHostAddress());
        }
        catch(Exception e){
            System.out.println("Exception Caught");
        }
    }
}

No comments:

Post a Comment