Display IP Address
Program :-
// Q1. Write a Program Where Visible Your IP Address of System.
import java.util.*;
import java.net.InetAddress;
class IPAddress{
public static void main(String args[]) throws Exception{
System.out.println(InetAdress.getLocalHost());
}
}
Output:
PS D:\Learning File\BCA\BCA 3rd Sem\JAVA OOP\allpraque> java IPAddress
Shailesh/192.168.108.104
Comments