Results 1 to 1 of 1
Thread: Getting address of Local Machine
-
Getting address of Local Machine
Java.io package provides methods that can get the local machine name and address. Review the code below:
Output:Java Code:try { InetAddress address = InetAddress.getLocalHost( ); System.out.println(address); } catch (UnknownHostException ex) { System.out.println("Could not find this computer's address."); }
Java Code:javapc/127.0.0.1
Similar Threads
-
Are Local variables thread safe ?
By samson in forum Threads and SynchronizationReplies: 6Last Post: 12-21-2010, 02:34 PM -
Getting name/ip of a machine
By Java Tip in forum Java TipReplies: 0Last Post: 03-02-2008, 07:11 PM -
Java failed to reach to a PC in local LAN
By JavaEmpires in forum NetworkingReplies: 1Last Post: 01-24-2008, 06:30 PM -
How to determine all the IP addresses of machines on local LAN??
By JavaEmpires in forum NetworkingReplies: 3Last Post: 01-19-2008, 06:05 AM -
Updating Local Content
By ibanez270dx in forum Java AppletsReplies: 1Last Post: 11-02-2007, 01:55 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks