Java: Find the IP ADDRESS OF THE SYSTEM


Step 1: Open the text editor.
Step 2:Write the codings on the editor.
Step 3:Include the necessary packages.
Step 4:include the code
            InetAddress.getLocalHost()
            To get the IP address of the system.
Step 5:save the program with .java extension.
Step 6:Run the program.
Step 7:the IP address will be displayed .
PROGRAM

import java.io.*;
import java.net.*;
class first
{   public static void main(String args[])
{
Try   {
System.out.println("address ="+InetAddress.getLocalHost());
}
catch(Exception e)
{ }
}}



OUTPUT
C:\jdk1.3\bin>javac first.java
C:\jdk1.3\bin>java first
address =lab17-13/192.168.7.93