View Single Post
  #1 (permalink)  
Old 04-21-2008, 09:49 PM
jon80 jon80 is offline
Member
 
Join Date: Feb 2008
Posts: 23
jon80 is on a distinguished road
doesn't compile?!
On Java API this is declared as

Code:
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]

Last edited by jon80 : 04-21-2008 at 10:51 PM. Reason: UPDATE 1 = UPDATING CODE TAGS
Reply With Quote
Sponsored Links