Note: D:\Study\Java\Thinking in Java 2nd 11 rev (code)\c09\SimpleCollection.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.第一次出现的时候试着用javac -nowarn 调过去了,这一次过不去,老是出现usage:的提示
请问是怎么回事呢?我第一次学java

解决方案 »

  1.   

    怪了~
    重新开启java文件,重新编译(用-nowarn参数),然后java $File就没问题了
    烦请高手解释一下
    下面是源代码
    //: c09:SimpleCollection.java
    // From 'Thinking in Java, 2nd ed.' by Bruce Eckel
    // www.BruceEckel.com. See copyright notice in CopyRight.txt.
    // A simple example using Java 2 Collections.
    import java.util.*;public class SimpleCollection {
      public static void main(String[] args) {
        // Upcast because we just want to
        // work with Collection features
        Collection c = new ArrayList();    for(int i = 0; i < 10; i++)
          c.add(Integer.toString(i));
        Iterator it = c.iterator();
        while(it.hasNext())
          System.out.println(it.next());
      }
    } ///:~
      

  2.   

    我这运行,没有任何问题啊
    应该不是程序的问题,楼主应该想想环境或者配置的问题。测试环境:
    系统:XP with SP2
    IDE: eclipse-SDK-3.0.1 
    测试结果:
    0
    1
    2
    3
    4
    5
    6
    7
    8
    9
      

  3.   

    错误提示(就是那些note)还不知道原因运行不了知道原因了,我用的是最简单的textpad,调用java的时候文件名的问题