public class HUAWEI{ //创建类 String pinpai; String xinghao; String yanse; int neicun ; int cpu ; double pingmuchicun; double shijian ; int xiangsu ;
public class HV { public static void main(String[] args) { //调用类 HUAWEI P8 = new HUAWEI(); HUAWEI Mates = new HUAWEI(); HUAWEI Mate8 = new HUAWEI(); P8.pinpai = "华为 P8max"; Mates.pinpai = "华为 Mates"; Mate8.pinpai = "华为 Mate8 "; P8.neicun = 32; Mates.neicun = 32; Mate8.neicun = 64; P8.pingmuchicun = 6.8; Mates.pingmuchicun = 5.5; Mate8.pingmuchicun = 6.0; P8.xiangsu = 13000000; Mates.xiangsu = 13000000; Mate8.xiangsu = 16000000; P8.xinghao = "华为 P8max DAV-706L 标配版双4G(日晖金)"; Mates.xinghao = "华为Mate S(CRR-UL00)标配版 双4G(星辰银)"; Mate8.xinghao = "HUAWEI NXT-AL10"; P8.yanse = "金色"; Mates.yanse = "银色"; Mate8.yanse = "香槟金"; P8.shijian = 2015; Mates.shijian = 2015; Mate8.shijian = 2015.11; P8.cpu = 8; Mates.cpu = 8; Mate8.cpu = 8; System.out.println("品牌:"+P8.pinpai+"型号:"+P8.xinghao+"上市时间:"+P8.shijian+"\t"+ "颜色:"+P8.yanse+"CPU核数"+P8.cpu+"内存:"+P8.neicun+"屏幕尺寸:"+P8.pingmuchicun+"像素:"+P8.xiangsu); System.out.println("品牌:"+Mates.pinpai+"型号:"+Mates.xinghao+"上市时间:"+Mates.shijian+"\t"+ "颜色:"+Mates.yanse+"CPU核数"+Mates.cpu+"内存:"+Mates.neicun+"屏幕尺寸:"+Mates.pingmuchicun+"像素:"+Mates.xiangsu); System.out.println("品牌:"+Mate8.pinpai+"型号:"+Mate8.xinghao+"上市时间:"+Mate8.shijian+"\t"+ "颜色:"+Mate8.yanse+"CPU核数"+Mate8.cpu+"内存:"+Mate8.neicun+"屏幕尺寸:"+Mate8.pingmuchicun+"像素:"+Mate8.xiangsu); }