java里没有typerof ,要用instanceof
基础类型不行,要用对象
Integer i = 0;
if (i instanceof Integer) {
System.out.println("haha");
}
String str = "abc";
if (str instanceof Object) {
System.out.println("haha");
}
java里没有typerof ,要用instanceof
基础类型不行,要用对象
Integer i = 0;
if (i instanceof Integer) {
System.out.println("haha");
}
String str = "abc";
if (str instanceof Object) {
System.out.println("haha");
}