在Eclipse里定义一变量出现提示是“不严重错误”
private boolean con;信息是:
     The field“con” is never read locally建议的三种处理方式是:
    1.Remove declaration of "con" and assigments without possible side effects
    2.Rename in file(ctrl+2,R direct access)
    3.Add @supperWarnings "unused" to "con"

解决方案 »

  1.   

    给这个变量赋值~~~private boolean con = false;
      

  2.   

    The field“con” is never read locally 
    这个提示已经很明确了。就是说这个属性变量你根本就没有使用,所以eclipse会建议你把这个属性去掉,或者加上@supperWarnings 符号,他就会忽略这个问题了。
     首先你要知道这个不是错误,呵呵,只是一个提示而已。
      

  3.   

    在java中应该养成初始化变量的习惯
      

  4.   

    赋值问题 private boolean con=false;
      

  5.   

    楼主这是警告,不是错误
    如果你不想这样的提示出现的话,在你的类的前面加上
    @SuppressWarnings("unused") eclipse就不会提示你了
      

  6.   

    信息是:
        The field “con” is never read locally 
        私有实例域 “con” 从未在本类中读取过(声明了又不用,浪费资源,此处为警告信息)
    建议的三种处理方式是:
        1.Remove declaration of "con" and assignments without possible side effects
        在没有副作用的情况下删除实例域 “con” 的声明(建议使用)
        2.Rename in file(ctrl+2,R direct access)
        重命名此实例域
        3.Add @supperWarnings "unused" to "con"
        添加 @supperWarnings 标记把 “con” 标记为未使用的(不建议,这只是让编译器忽略此处的警告,有点自欺欺人)