import java.io.*;
import javax.comm.*;
import java.util.*;

public class SerialTest {
   
  static CommPortIdentifier portid;
  public SerialTest() {
      
      Enumeration e = CommPortIdentifier.getPortIdentifiers();
      int i=1;
      System.out.println(e.hasMoreElements());
      while(e.hasMoreElements ())
      {
         portid = (CommPortIdentifier)e.nextElement ();
         System.out.println(i++ +" "+portid.getName());
      }
   }
   static public void main(String argv[]) {
      new SerialTest();
   }
}
