On Java API this is declared as
public final class NetworkInterface
extends Object
Java Platform SE 6
Any idea why it does not compile?
[code]
*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package testone;
/**
* @author User
*/
import java.net.*;
public class Main {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
NetworkInterface ni = new NetworkInterface();
//Error:
//Compiling 1 source file to C:\Documents and Settings\User\My //Documents\NetBeansProjects\TestOne\build\classes
//C:\Documents and Settings\User\My //Documents\NetBeansProjects\TestOne\src\testone\Mai n.java:22: cannot //find symbol
//symbol : constructor NetworkInterface()
//location: class java.net.NetworkInterface
// java.net.NetworkInterface ni = new java.net.NetworkInterface();1 error
ni2 = java.net.NetworkInterface;
System.out.println(ni.getDisplayName());
}
}
[code]