getLocalHost() function is used to display Name and IP address of local system.
getByName(" ") function is used to display Name and IP address of a given website.
getAllByName() function is used to display more than one IP address of a given website.
import java.net.*;
public class Main{
public Main(){
}
public static void main(String[] args) {
try
{
InetAddress add= InetAddress.getLocalHost();
getByName(" ") function is used to display Name and IP address of a given website.
getAllByName() function is used to display more than one IP address of a given website.
import java.net.*;
public class Main{
public Main(){
}
public static void main(String[] args) {
try
{
InetAddress add= InetAddress.getLocalHost();