摘要: 温故而知新(明天写注释回顾) class Account{ private String id; private double balance; private double annualInterestRate; public Account(){} public Account(String i 阅读全文
posted @ 2022-06-21 20:46 _八级大狂风 阅读(62) 评论(0) 推荐(0)
摘要: class Book{ private String title; private int ; public Book(){ //无参构造可以作为提示信息;例如: title = "未知"; pageNum = "00"; } public Book(String s1, int s2){ titl 阅读全文
posted @ 2022-06-21 16:15 _八级大狂风 阅读(46) 评论(0) 推荐(0)
摘要: class Husband{ String name; String id; String brith; Wife wife; public Husband(){ } public Husband(String s1, String s2, String s3, Wife w){ name = s1 阅读全文
posted @ 2022-06-21 12:13 _八级大狂风 阅读(20) 评论(0) 推荐(0)
摘要: this是一个关键字,全部小写。 一个对象一个this。 this是一个变量,是一个引用,this保存当前对象的内存地址,指向自身。 可以说this代表的就是‘当前对象’ this存储在堆内存当中对象的内部。 this只能使用在实例方法中。谁调用这个实例方法,this就是谁。 public clas 阅读全文
posted @ 2022-06-21 12:12 _八级大狂风 阅读(565) 评论(0) 推荐(0)