思想:看到事物首先抽象出类和对象,其次看类和对象有哪些属性和方法,看类和类之间有哪些继承关系。
继承;聚合;实现关系:多态
new出来的东西拥有这个类的所有的属性
public class Person { int id; int age = 20; Person(int_id, int_age) { id = _id; age = _age; } public static void main(String[] args) { Person tom = new Person(1,25); } }
当指定了构造方法时,就不能使用系统自动的构造函数了