Java equals() 方法
Java 教程
· 2019-02-08 10:27:18
equals() 方法用于判断 Number 对象与方法的参数进是否相等。
语法
public boolean equals(Object o)
参数
o -- 任何对象。
返回值
如 Number 对象不为 Null,且与方法的参数类型与数值都相等返回 True,否则返回 False。
Double 和 Float 对象还有一些额外的条件,可以参阅 API 手册:JDK 1.6。
实例
public class Test{
public static void main(String args[]){
Integer x = 5;
Integer y = 10;
Integer z =5;
Short a = 5;
System.out.println(x.equals(y));
System.out.println(x.equals(z));
System.out.println(x.equals(a));
}
}
编译以上程序,输出结果为:
false true false
点击查看所有 Java 教程 文章: https://codercto.com/courses/l/12.html
The Intersectional Internet
Safiya Umoja Noble、Brendesha M. Tynes / Peter Lang Publishing / 2016
From race, sex, class, and culture, the multidisciplinary field of Internet studies needs theoretical and methodological approaches that allow us to question the organization of social relations that ......一起来看看 《The Intersectional Internet》 这本书的介绍吧!