InetAddress

        System.out.print("Insert HostName: ");
        Scanner input=new Scanner(System.in);
        String host=input.nextLine();
        try{
            InetAddress ip=InetAddress.getByName(host);
            System.out.println(ip);
            if(ip.isReachable(50)){
                System.out.println("Destination Reached");
            }
            else{
                System.out.println("Destination Unreachable");
            }
        }
        catch (Exception e){
            System.out.println("Invalid domain");
        }

Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
InetAddress.getByName(dest); InetAddress.getHostAddress() inetaddress address = inetaddress.getbyname(host) inetaddress getbyname(string host) return a / before name inet address class in java inetaddress.getlocalhost() inetaddress getlocalhosy java api inetaddress java inetaddress server inetaddress methdos java.net inetaddress inetaddress in java inetaddress in java methods inetaddress clas java.net.anyLocalAddress java getbyname type safety inetaddress in java networking inetaddress class in java WAP to demonstrate the use of InetAddress class and its factory methods In Inet Address class, which method returns the host name of the IP Address?A. Public String get Hostname()B. Public String getHostAddress()C. Public static InetAddress get Localhost()D. Public getByName() inetaddress java only number Class InetAddress java.net.InetAddress java ip class what is Inet address class One of the following the java.net Net Address class represents. which best describes inet address class in java Which best describes Inet Address Class? import java.net.inetaddress java inetAdress What does the java.net.InetAddress class represent? In Inet Address class, which method returns the host name of the IP Address? java inetaddress getbyname vs getallbyname inet address java inetaddress.getbyname inetaddress ip inet address inetaddress java doc method returns inet addresss of local host inetaddress how to connect by ip inetaddress java docs how to get the hostname given the ip address using intaadress class java docs getbyaddress inetaddress what does java inetaddress.getbyname takes as an argument java inetaddress.getbyname inet java what is inet address import inetaddress java inet address java import In Inet Address class, which method returns the host name of the IP Address? *2 pointsPublic String get Hostname()Public static InetAddress get Localhost()Public String getHostAddress()Public getByName( inetaddress methods inetaddress methobs InetAddress by ip inetaddress java inetaddress in java java InetAddress syntax for inetaddress in java with raw ip address import java.net.InetAddress; inet class in java inetaddress class java String ip=java.net.InetAddress.getByName(host).getHostAddress(); Inet addres java inetaddress resolution inetaddress name resolution InetAddress
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source