一个类无法直接使用,需要导包,即类的地址。
格式:import 包名称.类名称;
如果在一个包内则无需导包。
创建对象:
格式:类名称 对象名=new()类名称;
使用:
使用成员变量:
对象名.成员变量名
使用成员方法:
对象名.成员方法(参数);
成员变量如果没赋值会有默认值