标题:请问关于这个怎么写测试代码?
只看楼主
林康
Rank: 1
等 级:新手上路
帖 子:27
专家分:0
注 册:2017-10-31
结帖率:14.29%
已结贴  问题点数:10 回复次数:1 
请问关于这个怎么写测试代码?
package student;
import java.util.*;
public class Teacher {
    long teacherID;
    String teacherName;
    int intime;
    String technicalTitle;
    String courses;
        Teacher (long tid,String tn,int it)
        {
        teacherID=tid;
        teacherName=tn;
        intime=it;
        technicalTitle="无";
        }

    Teacher(){
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }
        long getTeacherID()
        {
        return teacherID;
        }
        String getteacherName()
        {
        return teacherName;
        }
        String getTechnicalTitle()
        {
        return technicalTitle;
        }
        void setTechnicalTitle(String newtitle)
        {
        Calendar myCalendar=Calendar.getInstance();
        myCalendar.setTime(new Date());
        if((myCalendar.get(Calendar.YEAR)-intime)>5)
            technicalTitle=newtitle;
        else
            System.out.println("未到晋升时间,尚不能晋升职称。");
        }
        String SetCourses(String newc)
        {
            courses=newc;
            return courses;
        }
        public String toString()
{
return "该老师是:"+teacherID+"|"+teacherName+"|"+intime+"|"+technicalTitle+
"|"+courses;

}
}
搜索更多相关主题的帖子: 测试 Teacher String return Calendar 
2018-04-17 20:44
疯狂的小a
Rank: 10Rank: 10Rank: 10
等 级:贵宾
威 望:39
帖 子:423
专家分:1871
注 册:2018-2-6
得分:10 
你这个是想做啥。。。。

假如人生没有梦想,和咸鱼有什么区别!
2018-04-17 21:23



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-486150-1-1.html




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

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