java7.instance of关键字
来源:互联网 发布:mac五笔输入法哪个好 编辑:程序博客网 时间:2024/06/07 12:46
1.示例:
class A { public void tell1() { System.out.println("A--tell1"); } public void tell2() { System.out.println("A--tell2"); }}class B extends A { public void tell1() {// 父类方法重写 System.out.println("B--tell1"); } public void tell3() { System.out.println("B--tell3"); }}public class PolDemo01 { public static void main(String[] args) { A a = new A(); System.out.println(a instanceof A);//判断a是否为A的一个对象 System.out.println(a instanceof B); A a1 = new B(); System.out.println(a1 instanceof A); System.out.println(a1 instanceof B); }}
结果:
0 0
- java7.instance of关键字
- instance of关键字
- final关键字[java7高级进阶]
- static关键字[java7高级进阶]
- Java之Instance关键字
- my instance of IDL
- instance of 泛型
- The instance of keyword
- instance of,isInstance,isAssignableFrom
- Java Info Instance Of
- instance of 的含义
- java instance of用法
- identifier of an instance of
- java7
- Java7
- Java7
- Java7
- java7
- jQuery.data() 函数详解
- 聚类图像像素 Clustering Pixels Using K-Means
- 中文编码--深入分析 Java 中的中文编码问题
- Python学习笔记——条件判断与循环
- linux-mysql-store-result
- java7.instance of关键字
- iOS开发之CGPoint、CGSize、CGRect、CGRectMake、window(窗口)、视图(view)
- Spring auto wire(自动装配) 的 五种方式
- VLD简介
- 聚类 K-Means Using Python
- Java nio:Buffer总结
- 我的2015书影音记录
- 怎样批量修改文件后缀
- 二进制、八进制、十进制和十六进制之间的相互转换(正数)!