"颜色无法解析为类型"?

时间:2016-12-07 02:08:52

标签: java eclipse compiler-errors

import java.awp.*;
public class Reindeer
{
  private String name;
  private boolean canFly;
  private Color noseColor;
  private int antlers;

  public Reindeer()
  {
  }
  public Reindeer(String nameIn, boolean canFlyIn, Color noseColorIn, int antlersIn)
  {
    name = nameIn;
    canFly = canFlyIn;
    noseColor = noseColorIn;
    antlers = antlersIn;
  }
  public String getName()
  {
    return name;
  }
  public boolean getCanFly()
  {
    return canFly;
  }
  public Color getNoseColor()
  {
    return noseColor;
  }
  public int getAntlers()
  {
    return antlers;
  }
  public void setCanFly(boolean canFlyIn)
  {
    canFly = canFlyIn;
  }
  public void setNoseColor(Color noseColorIn)
  {
    noseColor = noseColorIn;
  }
  public void setAntlers(int antlersIn)
  {
    antlers = antlersIn;
  }
  public String toString()
  {
    return "The Reindeer's name is " + name + " and it has a " + noseColor + " nose.";
  }
}

如果我得到一些帮助,不确定在这里做什么会很棒。我知道我必须导入一些东西,但我已经忘记了它是什么,我相信这是' import java.awp。*;'谢谢!

1 个答案:

答案 0 :(得分:1)

我认为这是一个错字。 java。*顶级包是受限制的,因此只有很多,它们都是已知的。 awp可能应该是awt