摘要: 类的实例化:类名 对象名 = new 类名(); Person person = new Person(); 类本身自带无参构造器 使用new关键字,本质上是在调用构造器 一旦定义有参构造器,无参构造器就需要显示定义 //学生类 public class Student { String name; 阅读全文
posted @ 2022-10-11 19:17 Bravo_life 阅读(35) 评论(0) 推荐(0)