MyEclipse 10编程总是提示The type Cat is already defined错误



MyEclipse 10编程总是提示The type Cat is already defined错误

2014-10-15 23:49  提问者悬赏: 30分  |  lijian1103cn  |  分类:JAVA相关  |  浏览42次
class Cat{
 String name;
 int age;
 String color;
 public void set(String name,int age,String color){
  this.name=name;
  this.age=age;
  this.color=color;
 }
 public String toString(){
  return "姓名:"+name+"\t年龄:"+age+"\t颜色:"+color;
 }
 public Cat abc(){
  return this;
 }
}
public class A6_11{
 public static void main(String[] args){
  Cat one=new Cat();
  Cat two=new Cat();
  one.set("小明",12,"黑色");
  two.set("小红",14,"紫色");
  Cat three=new Cat();
  three=two.abc();
  System.out.println(one);
  System.out.println(two);
  System.out.println(three);
 }
}
这里总是提示Cat类 The type Cat is already defined
我用记事本编的一样的程序在CMD下就可以运行。这是为啥呢
2014-10-21 15:18 网友采纳

我用eclipse是没问题的,应该是你本机的配置问题


MyEclipse 10编程总是提示The type Cat is already defined错误

2014-10-15 23:49  提问者悬赏: 30分  |  lijian1103cn  |  分类:JAVA相关  |  浏览42次
class Cat{
 String name;
 int age;
 String color;
 public void set(String name,int age,String color){
  this.name=name;
  this.age=age;
  this.color=color;
 }
 public String toString(){
  return "姓名:"+name+"\t年龄:"+age+"\t颜色:"+color;
 }
 public Cat abc(){
  return this;
 }
}
public class A6_11{
 public static void main(String[] args){
  Cat one=new Cat();
  Cat two=new Cat();
  one.set("小明",12,"黑色");
  two.set("小红",14,"紫色");
  Cat three=new Cat();
  three=two.abc();
  System.out.println(one);
  System.out.println(two);
  System.out.println(three);
 }
}
这里总是提示Cat类 The type Cat is already defined
我用记事本编的一样的程序在CMD下就可以运行。这是为啥呢
2014-10-21 15:18 网友采纳

我用eclipse是没问题的,应该是你本机的配置问题


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值