zbdxcyg

废话不说,直接看例子

public class TestXY {
	public static void main(String[] args) {
		String string = new String();
		Object object = new Object();
		//用法:实例对象  instanceof  类名
		System.out.println(string instanceof String);//运行结果为true
		System.out.println(string instanceof Object);//运行结果为true
		System.out.println(object instanceof String);//运行结果为false
	}
}

  运行结果为boolean类型。

分类:

技术点:

相关文章:

  • 2021-11-27
  • 2021-11-27
  • 2021-09-27
  • 2021-11-27
  • 2021-11-17
  • 2021-09-27
  • 2021-11-27
  • 2021-11-27
猜你喜欢
  • 2021-11-27
  • 2021-11-27
  • 2021-09-27
  • 2021-11-27
  • 2021-11-27
  • 2021-11-27
相关资源
相似解决方案