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

📄 testbean.java

📁 JAVA编程百例书中各章节的所有例子的源代码,包括套接字编程
💻 JAVA
字号:
package ch04.section02;

public class TestBean {

  private String Name;
  private String Age;
  private String Info;

  public TestBean() {
    init();
  }

  public void init() {
    this.Name = "张三";
    this.Age = "28";
  }

  public void setName(String value) {
    this.Name = value;
  }

  public String getName() {
    return this.Name;
  }

  public void setAge(String value) {
    this.Age = value;
  }

  public String getAge() {
    return this.Age;
  }

  public String getInfo() {
    String s_Info = "你的姓名是" + ConvertGBK(this.Name) + ",你的年龄是" +
        ConvertGBK(this.Age) + " 岁。";
    return s_Info;
  }

  public String getNameAge() {
    String s_Info = "你的姓名是" + this.Name + ",你的年龄是" + this.Age + " 岁。";
    return s_Info;
  }

  public String ConvertGBK(String str) {
    String strReturn = "";
    try {
      strReturn = new String(str.getBytes("ISO-8859-1"), "gb2312");
    }
    catch (Exception ex) {
      System.out.println("TestBean.ConvertGBK():ex=" + ex.toString());
    }
    finally {
      return strReturn;
    }
  }

}

⌨️ 快捷键说明

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