Thursday, September 10, 2020

JAVA Program | Get IP Address of Computer System | diploma Computer Engineering |

 

//JAVA Program to Get IP Address of Computer System 

package Diploma;

import java.net.InetAddress;

public class IPA

{

 public static void main(String args[]) throws Exception

 {

      InetAddress addr = InetAddress.getLocalHost();

      System.out.println("Local IP Host Address: "+addr.getHostAddress());

      String hostname = addr.getHostName();

      System.out.println("Local Host name: "+hostname);

 }

}

No comments:

Post a Comment

CMS - 2024 || JAC INTERMEDIATE EXAMINATION - 2024 || 12th COMPUTER SCIENCE!

  Part-A Multiple Choice Questions 1) Who is the developer C++? a) Von Neumann b) Dennis M. Ritchie c) Charles Babbage d) Bjarne Stroustrup ...