错误:我在命令行上编译java类时找不到符号..?

时间:2015-02-08 15:31:40

标签: java



public class Course {

  private String title;
  private String instructor;
  private double price;
  public enum CustomerType {
    PROGRAMMING, MATHEMATICS, PHOTOGRAPHY, MUSIC, PAINTING, MISC
  };
  private CourseType cType;
  private Date startDate;
  private Date endDate;

  public Course()
  {
    setTitle("");

    setInstructor("");
    setPrice(0.0);
    setCType("");
    setStartDate(new Date());
    setEndDate(new Date());
  }
  public Course(String title, String instructor, double price, Date startDate, Date endDate)
  {
    setTitle(title);
    setInstructor(instructor);
    setPrice(price);
    setStartDate(startDate);
    setEndDate(endDate);
  }

  public void setTitle(String title)
  {
    this.title = title;
  }

  public void setInstructor(String instructor)
  {
    this.instructor = instructor;
  }

  public void setPrice(double price)
  {
    this.price = price;
  }

  public void setCType(CourseType cType)
  {
    this.cType = cType;
  }

  public void setStartDate(Date startDate)
  {
    this.startDate = startDate;
  }

  public void setEndDate(Date endDate)
  {
    this.endDate = endDate;
  }

  public String getTitle()
  {
    return title;
  }

  public String getInstructor()
  {
    return instructor;
  }

  public double getPrice()
  {
    return price;
  }

  public CourseType getCType()
  {
    return cType;
  }

  public Date getStartDate()
  {
    return startDate;
  }

  public Date getEndDate()
  {
    return endDate;
  }

  public double calculateCharge(Customer.CustomerType c)
  {
    return 0.0;
  }

  public String toString()
  {
    return ("title" + title + "instructor" + instructor + "price" + price + "cType" + cType);
  }
}




我尝试检查拼写和格式,但无法找到任何内容。

这是我编译时遇到的三个错误:

错误找不到符号 public CourseType getCTpe()

错误找不到符号 public void setCType(CourseType cType)

错误找不到符号 public CourseType cType;

1 个答案:

答案 0 :(得分:0)

您需要与Course班级对应的班级CourseType中的导入声明。

import fullyQualifiedPath.CourseType