每日总结

今天复习的是类的属性,类的属性分为两类:成员属性和局部变量,他们的作用范围不同。

学习了this关键字的作用和使用方法,主要用于构造函数中。

public class Account {
private String accountID;
private String accountname;
private String operatedate;
private int operatetype;
private String accountpassword;
private int accountbalance;
private int amount;
public Account(String accountID, String accountname, String operatedate, int operatetype, String accountpassword,
int accountbalance, int amount) {
super();
this.accountID = accountID;
this.accountname = accountname;
this.operatedate = operatedate;
this.operatetype = operatetype;
this.accountpassword = accountpassword;
this.accountbalance = accountbalance;
this.amount = amount;
}
public Account(String accountID, String accountname, String operatedate, int operatetype, int amount) {
super();
this.accountID = accountID;
this.accountname = accountname;
this.operatedate = operatedate;
this.operatetype = operatetype;
this.amount = amount;
}

posted @ 2020-10-30 19:48  小萌新一枚lll  阅读(51)  评论(0编辑  收藏  举报