Log in

View Full Version : Java


filburt1
06-07-2003, 11:24 PM
Anybody who's bored, try running this code and pasting the output here:

import java.net.NetworkInterface;
import java.net.SocketException;
import java.util.Enumeration;

public class UniqueId
{
public static void main(String[] args)
{
try
{
Enumeration e = NetworkInterface.getNetworkInterfaces();
NetworkInterface n;

while (e.hasMoreElements())
{
n = (NetworkInterface)e.nextElement();
System.out.println(n.hashCode());
}

System.out.println("Getting unique ID...");
}
catch (SocketException e)
{
e.printStackTrace();
}
}
}


Does it display the exact same value(s) each time you run it?

The output should be like

2130706433
-1062731612
Getting unique ID...


Would be greatly appreciated; thanks :)

filburt1
06-07-2003, 11:53 PM
I'm guessing nobody's used Java before, come to think of it...:(

Dean C
06-08-2003, 08:56 AM
I have JAVA compatibility on mozilla - don't know how to use it ?

filburt1
06-08-2003, 01:14 PM
It's not an applet but code to compile and run in the command prompt (or a Java IDE)...

Chris M
06-08-2003, 06:53 PM
If you told me how to, I would know:)

Satan

filburt1
06-08-2003, 06:54 PM
:p Don't worry, I'm going to put an applet online soon. I'm just tweaking it a bit (and relearning half my Java from two years ago).