zoukankan      html  css  js  c++  java
  • Java 2017.11.06 杨浩宁作业(2)

    package top.hyself;
    
    public class F$Demo {
    
        public static void main(String[] args) {
            // TODO Auto-generated method stub
            new F$Demo().fun();
    
        }
    
        private void fun() {
            System.out.println("Hello World!!!");
        }
    
    }
    package top.hyself;
    
    public class F$Demo {
        String name;int age;
        public F$Demo(String name,int age) {
            this.name = name;
            this.age = age;
        }
        public boolean compare(F$Demo per) {
            if(this == per) {
                return true;
            }
            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 static void main(String[] args) {
            // TODO Auto-generated method stub
            F$Demo per1 = new F$Demo("cousins",26);
            F$Demo per2 = new F$Demo("cousins",26);
            if(per1.compare(per2)){
                System.out.println("是同个人!");
            }
        }
    }
  • 相关阅读:
    Node.js NPM 包(Package)
    Node.js NPM 作用
    Node.js NPM 介绍
    Node.js NPM 教程
    Node.js NPM 教程
    Node.js 发送Email
    Node.js 上传文件
    Node.js 事件
    Node.js NPM
    Node.js 文件系统模块
  • 原文地址:https://www.cnblogs.com/Hyself/p/7811617.html
Copyright © 2011-2022 走看看