I want to find the ports present in the Windows 7 and I have written code for it. It successfully compiles but there is no output. I have Compiled in Netbeans
Here is my code:
import java.util.*;
import javax.comm.*;
public class PortLister {
public static void main(String[] args) {
Enumeration e = CommPortIdentifier.getPortIdentifiers();
while (e.hasMoreElements()) {
System.out.println((CommPortIdentifier) e.nextElement());
}
}
}