简体   繁体   中英

Deprecated java classes in stdlib.jar

I'm facing a problem with deprecated classes in a set of Libs for the Programming in Java tutorial. Currently, I'm trying to run ThreeSum.java and getting NoClassDefFoundError in cmd (Windows). The problem is that readInts(args[0]) class is deprecated. My programming skills are not good enough to fix it by myself. I would really appreciate your help.

readInts is a method not a class.

/**
 * Reads all ints from stdin.
 * @deprecated For more consistency, use {@link #readAllInts()}
 */
public static int[] readInts() {
    return readAllInts();
}

As you can see here, the fix is just to use readAllInts() . However, deprecated methods should still work. Verify that you have setup stdlib.jar correctly, and are including it in the class path when compiling.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM