JAVA-对象的使用
package com.itheima;
public class phonedemo01 {
public static void main(String[] args) {
//格式
phone p = new phone();
//使用成员变量
System.out.println(p.brang);
System.out.println(p.price);
p.brang="小米";
p.price=2999;
System.out.println(p.brang);
System.out.println(p.price);
//使用成员方法
p.call();
p.message();
}
}
```执行结果
```java
null
0
小米
2999
打电话
发短信
Process finished with exit code 0