1 Star 1 Fork 0

CS-IMIS-23/20172313yukunpeng

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Student.java 1.30 KB
一键复制 编辑 原始数据 按行查看 历史
余坤澎 提交于 7年前 . docs:example practice
//********************************************************************
// Student.java Author:Lewis/Loftus
//
// Represents a college student.
//********************************************************************
public class Student
{
private String firstName,lastName;
private Address homeAddress,schoolAddress;
//------------------------------------------------------------
//Constructor:Sets up this student with the specified values.
//------------------------------------------------------------
public Student(String first, String last, Address home, Address school)
{
firstName = first;
lastName = last;
homeAddress = home;
schoolAddress = school;
}
//------------------------------------------------------------
//Returns a string description of this Student object.
//------------------------------------------------------------
public String toString()
{
String result;
result = firstName + " " + lastName + "\n";
result += "Home Address:\n" + homeAddress + "\n";
result += "School Address:\n" + schoolAddress;
return result;
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/CS-IMIS-23/20172313yukunpeng.git
git@gitee.com:CS-IMIS-23/20172313yukunpeng.git
CS-IMIS-23
20172313yukunpeng
20172313yukunpeng
master

搜索帮助