• 11.06第十次、


    1——————————————————————————————————————————————————————————

    package GJS1;
    
    public class GJS {
        public static void main(String args[]) {
            new GJS().fun()    ;
        }
        public void fun() {
            System.out.println("Hello World!!!");
        }
    }

    2——————————————————————————————————————————————————

    package GJS1;
    
        class Person {
            private String name;
            private int age;
            public Person(String name,int age) {
                this.name = name;
                this.age = age;
            }
           
            public boolean compare(Person per) {
                if(this.name.equals(per.name)&&this.age==per.age) {
                    return true;
                }else {
                        return false;
                }
            }
                    
            public String getName() {
                return this.name;
            }
    
            public int getAge() {
                return this.age;
            }
        }
            public class GJS {
                public static void main(String args[]) {
                    Person per1 = new Person("张三",30);
                    Person per2 = new Person("张三",30);    
                    if(per1.getName().equals(per2.getName())&&per1.getAge()==per2.getAge()) {
                        System.out.println("是同一个人!");
                    }
                }
            }

    3————————————————————————————————————————————————————————————

    package GJS1;
    
    class Person{
        private String name;
        private int age;
        public Person(String name,int age) {
            this.name=name;
            this.age=age;
        }
        public String getName() {
            return this.name;
        }
        public int getAge() {
            return this.age;
        }
    }
    public class GJS {
        public static void main(String args[]) {
            Person per1 = new Person("王东升",20);
            Person per2 = new Person("王东升",20);
            if(per1.getName().equals(per2.getName())&&per1.getAge()==per2.getAge()) {
                System.out.println("是同一个人");
            }
        }
    }

  • 相关阅读:
    Nginx 基本命令
    Nginx配置详细
    MySQL 函数大全
    X-Frame-Options 配置
    Visual Studio提示“无法启动IIS Express Web服务器”的解决方法
    idea java 非web程序打包
    mysql 存储过程
    webstorm 重置所有设置
    vue input 赋值无效
    MySQL 性能优化神器 Explain 使用分析
  • 原文地址:https://www.cnblogs.com/fm10086/p/7862646.html
Copyright © 2020-2023  润新知