/** * 顧客類,含有用戶暱稱name、用戶userId、用戶密碼password * @author Fiuty */ public class Customer { private String name; private String userId; private String password; public String getName() { return name; } public void setName(String name) { this.name = name; } public String getUserId() { return userId; } public void setUserId(String userId) { this.userId = userId; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } }
這個是上面customer類的類圖描述:
屬性和方法前面的減號‘-’表明私有,加好‘+’表明公有,(還有#表明保護,底部劃一線時是表明靜態)。this