account.java
来自「USB设计的一些源码!适合与USB开发的同学!还是蛮不错的!我用过一些!」· Java 代码 · 共 38 行
JAVA
38 行
public class Account {
String firstName;
String lastName;
final String ACCOUNT_DATA_FILE = "AccountData.txt";
public Account(String fname, String lname) {
firstName = fname;
lastName = lname;
}
public boolean isValid() {
/*
Let's go with simpler validation
here to keep the example simpler.
*/
if (getLastName().trim().length() < 6)
return false;
return true;
}
public boolean save() {
FileUtil futil = new FileUtil();
String dataLine = getFirstName() + "," + getLastName();
return futil.writeToFile(ACCOUNT_DATA_FILE, dataLine,
true, true);
}
public String getFirstName() {
return firstName;
}
public String getLastName() {
return lastName;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?