1 Star 0 Fork 0

明希/Objects Early

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
ClassSchedule1.java 1.56 KB
一键复制 编辑 原始数据 按行查看 历史
明希 提交于 2020-05-12 19:14 . 提交练习1,2
/**
A class has a title, time and room
*/
public class ClassSchedule
{
private String title;
private String days;
private String startTime;
private String endTime;
private String room;
/**
Constructs a class with title, day, time and room.
*/
public ClassSchedule(String classTitle, String meetingDays, String aStartTime, String aEndTime, String classRoom)
{
title = classTitle;
days = meetingDays;
startTime = aStartTime;
endTime = aEndTime;
room = classRoom;
}
/**
Gets the title.
@return the title
*/
public String getTitle()
{
return title;
}
/**
Gets the time in the form "days start time-end time"
@return the time
*/
public String getTime()
{
String time = days + " " + startTime + "-" + endTime;
return time;
}
/**
Gets the room.
@return the room
*/
public String getRoom()
{
return room;
}
/**
Sets the days.
@param meetingDays the new meeting days
*/
public void setDays(String meetingDays)
{
// your work here
days = meetingDays;
}
/**
Sets the start time.
@param aStartTime the new start time
*/
public /* your work here */void setStartTime(String setSTime/* your work here */)
{
// your work here
startTime = setSTime;
}
/**
Sets the end time.
@param anEndTime the new end time
*/
// your work here
public void setEndTime(String setETime)
{
endTime = setETime;
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/mingxi1103/Objects-Early.git
[email protected]:mingxi1103/Objects-Early.git
mingxi1103
Objects-Early
Objects Early
master

搜索帮助