zoukankan      html  css  js  c++  java
  • 13

    1 public class Y {
     2      public static void main(String[] args) {
     3             // TODO Auto-generated method stub
     4             new Y().fun();
     5 
     6         }
     7 
     8         private void fun() {
     9             System.out.println("L-Y-H");
    10         }
    11 
    12     }
    复制代码
    复制代码
     1 public class L {
     2     String name;int age;
     3     public L(String name,int age) {
     4         this.name = name;
     5         this.age = age;
     6     }
     7     public boolean compare(L per) {
     8         if(this == per) {
     9             return true;
    10         }
    11         if(this.name.equals(per.name) && this.age == per.age) {
    12             return true;
    13         }else {
    14             return false;
    15         }
    16     }
    17     public String getName() {
    18         return this.name;
    19     }
    20     public int getAge() {
    21         return this.age;
    22     }
    23     public static void main(String[] args) {
    24         // TODO Auto-generated method stub
    25         L per1 = new L("cousins",26);
    26         L per2 = new L("cousins",26);
    27         if(per1.compare(per2)){
    28             System.out.println("这俩人一个样~");
    29         }
    30     }
    31 }
    
    
  • 相关阅读:
    mysql 版本查看
    js 中文乱码
    浏览器内核
    Squid 代理服务器
    minicygwin
    firefox 插件开发
    ocx c++
    NetBeans
    android 虚拟机
    ExpandableListView
  • 原文地址:https://www.cnblogs.com/zhangye119/p/8057349.html
Copyright © 2011-2022 走看看