Find Public IP Address in Java

 

Find Public IP Address in Java Programming

Here, we have posted a Simple Program that describes How To Find Public IP Address in Java Programming that you’re currently logged in. This Java Program is an IP Address Tracker Program wherein you can get the Public IP Address of your Machine only when you connect your System to the Internet.

What is an IP Address?

IP  stands for Internet Protocol Address. It is a 32-Bit Address String. It is a Numerical Tag associated with every Electronic Device such as Mobile Phone, Laptop, Desktop, Printer, Router, etc that helps to identify every single device connected to a Network. It is primarily used for Communication with different devices connected on the same Network.

 

How Does This Program Works?

This Program makes use of InetAddress Class to get the Public IP Address of your machine via WhatIsMyAdddress.com. However, this Program works only when your System is connected to the Internet. It gives an Error when Internet is not connected which we have handled through Exception.

Find Public IP Address in Java Programming Language

   

Output

Find Public IP Address in Java Programming Language

We hope that you got a basic information about How To Find Public IP Address in Java Programming Language. In case you get any Compilation Errors with this Java Program To Check Public IP Address or you have any doubt about it, let us know about it in the Comment Section below.

Recommended Programs
Find Local Host IP Address in Java Programming Language
Execute Linux gEdit Text Editor with Java Program
Java Program To Convert Numbers into Words
Print Map of India in Java Programming
100+ Java Programs

4 thoughts on “Find Public IP Address in Java

    1. Tushar Soni Post author

      Thank you Shanmukha! We hope you stay connected with us and find some excellent C Programs on our website!

      Reply
  1. basil raj

    thank very hopefully this program bro.. but i want to automatically alert ip address .how to find that profram ..please tell that progrma

    Reply

Let's Discuss