C:\j2sdk1.4.0_03\alist.java:1: package ConsoleReader does not exist
import ConsoleReader.*;
说明你要先找到这个包,因为这个包里面有你需要的类,哪个类呢,就是下面的错误
:\j2sdk1.4.0_03\alist.java:14: cannot resolve symbol
symbol  : class ConsoleReader  
location: class alist
    ConsoleReader console =new ConsoleReader(System.in);
中的ConsoleReader这个类

解决方案 »

  1.   

    我看了 其他章节没有建立过ConsoleReader这个库 这是我遇到这种问题的第一个问题
    import ConsoleReader.*   //引入已定义的数据输入类(这是它给的注释) 
    但书中又没告诉怎么建立这个类 如果改为用import java.io.*;再改一下程序 虽然可以运行 但书中以后的程序都有 import  ConsoleReader.*; 语句  每次都要改 好麻烦啊!!  各位大哥 有没有好的解决办法啊??  跪求啊!!
      

  2.   

    到清华大学出版社下载该书的ConsoleReader类。
      

  3.   

    /*
     * Created on 2004-7-14
     *
     * TODO To change the template for this generated file go to
     * Window - Preferences - Java - Code Style - Code Templates
     *//**
     * @author liujun
     *
     * TODO To change the template for this generated type comment go to
     * Window - Preferences - Java - Code Style - Code Templates
     */
    import java.io.BufferedReader;
    import java.io.InputStream;
    import java.io.InputStreamReader;
    import java.io.IOException;public class ConsoleReader 
    {
       public ConsoleReader()
        {
        }
        
        public ConsoleReader(InputStream inStream)
        {
        reader = new BufferedReader (new InputStreamReader(inStream));
        this.strTemp="temp";
       
        }
       
    public int readInt()  // 整数输入
        {  
        String inputString = readLine();
           int n = Integer.parseInt(inputString);
          
           return n;
        }
       
    public double readDouble()  // 浮点数输入
        {  
        String inputString = readLine();
           double x = Double.parseDouble(inputString);
          
           return x;
        } public String readLine()
        {  
        String inputLine = "";
       
           try
           {
           inputLine = reader.readLine();
           }
           catch(IOException e)
           {
           System.out.println(e);
              System.exit(1);
           }       return inputLine;
        }
       
        private BufferedReader reader; 
        public  String strTemp;
       
        public  short temp()
        {
            short s1 = 1;
            try
            {
            if(s1==1)
               return s1;
           
            
           
            
            
              
            }
            catch(Exception e)
            {
            }
            finally
            {
                
               this.strTemp="change";  
               
            }
            return 0;
            
           
        }
    }