The program to find the address of the local machine is given below:
import java.net.*;
public class InetAddressExample{
public static void main(String[] args){
try{
InetAddress address = InetAddress.getLocalHost();
System.out.println(address);
}catch(UnknownHostException e){
System.out.println(e);
}
}
}
0 Comments
If you have any question please ask?