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")
}
nextElement()如果此枚举对象至少还有一个可提供的元素,则返回此枚举的下一个元素。 利用这两个函数,利用while循环就可以读取里面的元素,当然读取出来得元素通过强制转换,就可以和变量进行比较 希望对你有所帮助