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-单链表的实现
    python-树形结构和遍历
    python四种简单排序
    python数据类型
    python安装和配置
    Js 中的false,零值,null,undefined和空字符串对象
    console和chrom-tool
    js中声明Number的五种方式
    vue下拉搜索
    canvas猜数游戏
  • 原文地址:https://www.cnblogs.com/zzyu/p/5498557.html
Copyright © 2011-2022 走看看