美文网首页
public class Credit

public class Credit

作者: 哈迪斯Java | 来源:发表于2023-06-18 21:43 被阅读0次

    public class Credit {
    String cardNum;
    String password;

    public Credit(String cardNum, String password) {
        this.cardNum = cardNum;
        this.password = password;
        if (password.equals("123456")) {
            System.out.println("信用卡" + cardNum + "的默认密码为" + password);
        } else {
            System.out.println("重置信用卡" + cardNum + "的密码为" + password);
        }
    }
    
    public Credit(String cardNum) {
        this(cardNum, "123456");
    }
    
    public static void main(String[] args) {
        Credit initialCredit = new Credit("4013735633800642");
        Credit resetedCredit = new Credit("4013735633800642", "168779");
    }
    

    }

    相关文章

      网友评论

          本文标题:public class Credit

          本文链接:https://www.haomeiwen.com/subject/mnphddtx.html