![]() |
|
|
|
| ||||||
|
Welcome to the The ProgrammersTalk Community forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
| Tags: |
![]() |
![]() | | LinkBack | Thread Tools | Display Modes | ![]() |
| |||
| This is my first tutorial at this forum, here i am showing you how to detect localhost name and local ip address import java.net.*; class Information { public static void main(String [] aa) { try{ System.out.println(InetAddress.getLocalHost().getH ostName()); System.out.println(InetAddress.getLocalHost().getH ostAddress()); }catch(Exception e){} } } compile it with save and compile it compile as follows: javac Information.java Run as follows: java Information note: If you face any problem please let me know... |
| |
![]() |
| Thread Tools | |
| Display Modes | |
| |