The code tags don't work like that. You must use "[COD...]Your Code Here[/COD...]". Just replace the "..."s with an "E" so it says, "CODE".
The problem is, your calling an object that doesn't exist:
NetworkInterface ni = new NetworkInterface();
NetworkInterface() doesn't exist to java. Have you created a NetworkInterface class?