u014677820
爱上猫咪的小鼠
2015-05-21 05:42

这两种写法有什么差别???请大家帮忙看一看

  • java
  • android

public void getBenjin() {
if (null != benjin.getText()) {
benjinD = Double.parseDouble(benjin.getText().toString());
}
}

public void getLilv() {
    if (null != lilv.getText()) {
        lilvD = Double.parseDouble(lilv.getText().toString());
    };
}

public void getShijian() {
    if (null != shijian.getText()) {
        shijianI = Integer.parseInt((shijian.getText().toString()));
    };
}

public void getNumber() {
if (null != benjin.getText()) {
benjinD = Double.parseDouble(benjin.getText().toString());
}

    if (null != lilv.getText()) {
        lilvD = Double.parseDouble(lilv.getText().toString());
    };

    if (null != shijian.getText()) {
        shijianI = Integer.parseInt((shijian.getText().toString()));
    };
}
  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

14条回答