This website works better with JavaScript.
首頁
探索
說明
登入
binhong
/
LibrarySystem
關註
1
收藏
0
複製
0
程式碼
問題管理
0
合併請求
0
版本發佈
0
Wiki
Activity
瀏覽代碼
Added User class
User.java is added with basic / expecting data and functionality
master
BinHong Lee
8 年之前
父節點
2ca886ce92
當前提交
cc03dca8fc
共有
1 個文件被更改
,包括
55 次插入
和
0 次删除
分割檢視
Diff Options
Show Stats
Download Patch File
Download Diff File
+55
-0
User.java
+ 55
- 0
User.java
查看文件
@@ -0,0 +1,55 @@
/*
* Written by : Bin Hong Lee
* Last edited : 6/4/2016
*/
class User
{
private String name;
private int id;
private int limit;
private List<int> books = new ArrayList<int>();
public User(String name, int id, int limit)
{
this.name = name;
this.id = id;
this.limit = limit;
}
public String getName()
{
return name;
}
public void setName()
{
this.name = name;
}
public boolean status()
{
if (books.size() < limit)
{
if (bookStatus)
{
return true;
}
}
return false;
}
public boolean borrowNewBook(int id)
{
if (status)
{
books.add(id);
return true;
}
else
{
return false;
}
}
}
Write
Preview
Loading…
取消
儲存