MyException - 我的异常网
当前位置:我的异常网» Java Web开发 » 有关类文件编译的有关问题!

有关类文件编译的有关问题!

www.MyException.Cn  网友分享于:2013-12-09  浏览:6次
有关类文件编译的问题!!高手请进!!!!!!
我定义了两个类,其中一个类用到类一个类,这两个类同属于一个包,如下:
package nttontology;
import java.util.Comparator;

public class ByValueComparator implements Comparator {

  public int compare(Object firstVector, Object secondVector) {

  float firstValue = ((Vector) firstVector).getValue();

  float secondValue = ((Vector) secondVector).getValue();

  if ((firstValue - secondValue) > 0)
  return -1;
  if ((firstValue - secondValue) < 0)
  return 1;
  else
  return 0;
  }
}
************
package nttontology;  
public class Vector {
  private int index;
  private float value;
  public Vector(int index, float value) {
  this.index = index;
  this.value = value;
  }
  public int getIndex() {
  return index;
  }
  public void setIndex(int index) {
  this.index = index;
  }
  public float getValue() {
  return value;
  }
  public void setValue(float value) {
  this.value = value;
  }  
}
出现以下错误提示:
C:\Tomcat\webapps\mytest\WEB-INF\classes\nttontology\ByValueComparator.java:8:
annot resolve symbol
symbol : class Vector
location: class nttontology.ByValueComparator
  float firstValue = ((Vector) firstVector).getValue();
  ^
C:\Tomcat\webapps\mytest\WEB-INF\classes\nttontology\ByValueComparator.java:10
cannot resolve symbol
symbol : class Vector
location: class nttontology.ByValueComparator
  float secondValue = ((Vector) secondVector).getValue();
  ^
2 errors
望高手指教!!!!!!!!!!!!!!!!

------解决方案--------------------
到C:\Tomcat\webapps\mytest\WEB-INF\classes\nttontology\目录下查看是否存在自定义的Vector.class类

文章评论

软件开发程序错误异常ExceptionCopyright © 2009-2015 MyException 版权所有