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();
                    
            
  • 相关阅读:
    图论概况
    [NOI2006]最大获利
    Dining
    [USACO5.3]校园网Network of Schools 缩点
    I Hate It
    [USACO06JAN]牛的舞会The Cow Prom Tarjan
    爱在心中
    [HAOI2006]受欢迎的牛
    泥泞的道路
    上白泽慧音
  • 原文地址:https://www.cnblogs.com/zzyu/p/5498557.html
Copyright © 2011-2022 走看看