• 第十次作业是同一个人


    1
    
    package cn.ch.w;
    
    public class StaticDemo 
    {
        public static void main(String args[])
        {
        new StaticDemo().fun();
        }
    
        private void fun() {
            // TODO 自动生成的方法存根
            System.out.println("JAVA程序语言设计");
        }
    }
    

      

    2 
    package nn;
    public class RL{
        private String name;
        private int age;
        public RL(String name,int age){
            this.name =name;
            this.age =age;
        }
        public boolean compare(RL r) {
            if(this.name.equals(r.name)&&this.age==r.age) {
                return true;
                }else {
                    return false;
                    }
        }
        public String getName() {
            return this.name;
            }
        public int getAge() {
            return this.age;
            }
    }
    
    package nn;
    
    public class CRL {
        public static void main(String args[]) {
            RL r1 = new RL("张三",30);
            RL r2 = new RL("张三",30);
            if(r1.compare(r2)) {
                System.out.println("r1和r2");
                System.out.println("是同一个人");
            }
        }
    
    }
    

      

     3
    package nn;
    
    public class ren {
        private int age;
        private String name;
        public ren(String name,int age) {
            this.name =name;
            this.age =age;
        }
        public boolean compare(ren l) {
            if(this==l) {
                return true;
            }
            if(this.name.equals(l.name)&&this.age==l.age) {
                return true;
                
            }else {
                return false;
            }
        }
        public String getName() {
            return this.name;
        }
        public int getAge() {
            return this.age;
        }
    
    }
    
    package nn;
    
    public class lei {
    
        public static void main(String args[]) {
            ren l1 = new ren("张三",20);
            ren l2 = new ren("张三",20);
            if(l1.compare(l1)) {
                System.out.println("是同一个人");
            }
            
    
        }
    
    }
    

      

    4
    package nn;
    class ee {    
            private String name;
            private int age;
            public ee(String name,int age) {
                this.name = name;
                this.age = age;
            }
            public void fun(ee te) {
                te.name ="lucy";
                te.age =23;
            }
            public String getName() {
                return this.name;
            }
            public int getAge() {
                return this.age;
            }
        }
    
    package nn;
    
    public class Cdmo {
    
        public static void main(String args[]) {
            ee son =new ee("tony",22);
            son.fun(son);
            System.out.println(son.getName() + "-->" +son.getAge());
    
        }
    
    }
    

      

    5
    
    package nn;
    public class qq {
        private String name;
        private String age;
        public qq(String name,String i){
            this.name=name;
            this.age=i;
        }
        public qq(String name2,int i) {
            
        }
        public String getName() {
            return this.name;
        }
    
        public String getAge() 
        {
            return this.age;
        }
    };
    package nn;
    public class sdf {
        public static void main(String args[]){
            qq per1 = new qq("理想",21);
            qq per2 = new qq("理想",21);
            {
                System.out.println("是同一个人!!");
            }   
        }
    };
    

      

  • 相关阅读:
    [BJOI2019] 删数
    [HNOI2019] 校园旅行
    [ARC093D] Dark Horse
    rpn模块
    通俗易懂谈强化学习
    np.random.choice()的用法
    深度学习模型量化
    np.array中的[::1]的一点理解
    如何增加深度学习模型的泛化能力(L1/L2正则化,dropout,数据增强等等)
    深度学习中的网络剪枝(pruning)简介
  • 原文地址:https://www.cnblogs.com/huiiuh/p/7825657.html
Copyright © 2020-2023  润新知