⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 address.java

📁 USB设计的一些源码!适合与USB开发的同学!还是蛮不错的!我用过一些!
💻 JAVA
字号:
public class Address {

  String address;
  String city;
  String state;

  final String ADDRESS_DATA_FILE = "Address.txt";

  public Address(String add, String cty, String st) {
    address = add;
    city = cty;
    state = st;
  }
  public boolean isValid() {
    /*
     	The address validation algorithm
     	could be complex in real-world
     	applications.
     	Let's go with simpler validation
     	here to keep the example simpler.
     */
    if (getState().trim().length() < 2)
      return false;

    return true;
  }
  public boolean save() {
    FileUtil futil = new FileUtil();
    String dataLine = getAddress() + "," + getCity() + "," +
                      getState();
    return futil.writeToFile(ADDRESS_DATA_FILE, dataLine,
           true, true);
  }
  public String getAddress() {
    return address;
  }
  public String getCity() {
    return city;
  }
  public String getState() {
    return state;
  }

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -