zoukankan      html  css  js  c++  java
  • java 类和对象的随堂笔记

    package com.hanqi;
    
    public class Text2 {
        public static void main(String[] args)
        {
            //构建一个手机new
            phone phone1 =new phone("华为");
            
            //phone1.pinpai="华为";
            phone1.Color="土豪金";
            phone1.Size=5.5;
            phone1.Ishanghuo=true;
            //拨打电话
            phone1.call();
            phone1.call("110");
            //播放音乐
            phone1.play();
            
            //构建另一个手机
                    phone phone2 =new phone("小米");
                    
                    //phone2.pinpai="小米";
                    phone2.Color="象牙白";
                    phone2.Size=5;
                    phone2.Ishanghuo=true;
                    //拨打电话
                    phone2.call();
                    //播放音乐
                    phone2.play();
                    
            
    package com.hanqi;
    
    public class Text2 {
        public static void main(String[] args)
        {
            //构建一个手机new
            phone phone1 =new phone("华为");
            
            //phone1.pinpai="华为";
            phone1.Color="土豪金";
            phone1.Size=5.5;
            phone1.Ishanghuo=true;
            //拨打电话
            phone1.call();
            phone1.call("110");
            //播放音乐
            phone1.play();
            
            //构建另一个手机
                    phone phone2 =new phone("小米");
                    
                    //phone2.pinpai="小米";
                    phone2.Color="象牙白";
                    phone2.Size=5;
                    phone2.Ishanghuo=true;
                    //拨打电话
                    phone2.call();
                    //播放音乐
                    phone2.play();
                    
            
  • 相关阅读:
    纪伯伦:我曾七次鄙视我的灵魂
    字典和集合
    元组
    列表
    字符串
    数值类型
    内置函数了解一下
    了解Python
    centos7安装mysql数据库
    xenserver 上传centos6.8镜像
  • 原文地址:https://www.cnblogs.com/zzyu/p/5498557.html
Copyright © 2011-2022 走看看