InetAddress Example

import java.net.InetAddress;
public class InetAddressDemo1 
{
	public static void main(String[] args) 
	{
		try
		{
	// InetAddress adr=InetAddress.getLocalHost();
	InetAddress adr=InetAddress.getByName("localhost");
	byte ip[]=adr.getAddress();
	for(byte b:ip)
	System.out.println(b);
		}
		catch(Exception e)
		{
			e.printStackTrace();
		}
	}
}

Download

Network Programming in Java

InetAddress Demo
Server/Client with Single threaded and multi threaded Server
Server/Client with Single threaded and multi threaded Server


Write your Comment

Name :
Email Id : [ We will not publish your email id ]
Your Comment : [ Maximum 200 chars ]
Enter Security code