zoukankan      html  css  js  c++  java
  • 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核心反向代理
    投票活动
    数据库的框架及优化之路
    sonarqube搭建遇到的问题
    robotframework+python3+selenium之下拉框的选择---第五集
    robotframework+python3+selenium之常用情景---第四集
    robotframework+python3+selenium之创建第一个项目---第三集
  • 原文地址:https://www.cnblogs.com/fm10086/p/7862646.html
Copyright © 2011-2022 走看看