| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 731 人关注过本帖
标题:大家帮我看下着是什么问题
取消只看楼主 加入收藏
huxiangwenhu
Rank: 4
等 级:业余侠客
威 望:1
帖 子:191
专家分:262
注 册:2010-6-1
结帖率:90.91%
收藏
已结贴  问题点数:10 回复次数:1 
大家帮我看下着是什么问题
Exception in thread "main" java.lang.Error: 无法解析的编译问题:

    at fouth.InterfaceTest.main(InterfaceTest.java:5)
我是用MyEclipse编写的,程序运行的时候出现以上错误
搜索更多相关主题的帖子: thread 
2010-08-24 19:24
huxiangwenhu
Rank: 4
等 级:业余侠客
威 望:1
帖 子:191
专家分:262
注 册:2010-6-1
收藏
得分:0 
package fouth;

public class InterfaceTest {
   
    public static void main(String[] args) {
        Student1 astudent=new Student1("tom", "123456");
        astudent.setAddress("beijing");
        astudent.setSex("men");
        System.out.println(astudent);
    }
}
interface Person{
    String getName();
    String getSex();
    String getBirthday();
    String getAddress();
    void setAddress(String strAddress);   
}
class Student implements Person,Comparable{
    private String strName="";
    private String strSex="";
    private String strNumber="";
    private String strBirthday="";
    private String strSpeciality="";
    private String strAddress="";
    public String getSex() {
        return strSex;
    }
    public void setAddress(String string) {
        // TODO Auto-generated method stub
        
    }
    public void setSex(String strSex) {
        this.strSex = strSex;
    }
    public String getBirthday() {
        return strBirthday;
    }
    public void setBirthday(String strBirthday) {
        this.strBirthday = strBirthday;
    }
    public String getSpeciality() {
        return strSpeciality;
    }
    public void setSpeciality(String strSpeciality) {
        this.strSpeciality = strSpeciality;
    }
    public String getAddress() {
        return strAddress;
    }
   
    public String getName() {
        return strName;
    }
    public String getNumber() {
        return strNumber;
    }
    public Student1(String strName, String strNumber) {
        super();
        this.strName = strName;
        this.strNumber = strNumber;
    }
    public String toString(){
        String information="学生姓名="+strName+",学号="+strNumber;
        if(!strSex.equals("")){
            information+=",性别="+strSex;
        }
        if(!strBirthday.equals("")){
            information+=",出生年月="+strBirthday;
        }
        if(!strSpeciality.equals("")){
            information+=",专业="+strSpeciality;
        }
        if(!strAddress.equals("")){
            information+=",籍贯="+strAddress;
        }
        return information;   
    }
    public void setAddress1(String strAddress) {
        this.strAddress=strAddress;

    int compareTo(Object otherObject) {
        Student other=(Student)otherObject;
        int otherNumber=Integer.parseInt(other.strNumber);
        return 0;
    }
        
    }
   
}
//这是全部代码,谢谢了
2010-08-26 21:21
快速回复:大家帮我看下着是什么问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.015756 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved