创建对象
类名 对象名=new 类名();
Telphone phone=new Telphone;
在程序中使用对象
package newStudy;
public class InitailTelphone {
public static void main(String[] args) {
// TODO Auto-generated method stub
Telphone phone=new Telphone();
//调用对象的方法
phone.sendMessage();
//给属性(实例变量)赋值
phone.screen=5.2f;
phone.cpu=1.4f;
phone.mem=64f;
//调用对象的方法
phone.sendMessage();
}
}