final、insranceof循环判断以及this,super
来源:互联网 发布:python win32自动化 编辑:程序博客网 时间:2024/06/06 20:29
一、final、instanceof
格式:父类对象instanceof 子类类型名(返回类型为boolean)
boolean 变量名= 父类对象 instanceof 子类类型名
二、循环判断结构
判断语句:if判断 switch判断
循环结构:for循环、while循环、do...while循环
do...while循环:无论什么前提下,一定会由一次循环执行
switch:只支持int和String判断
三、this、super
this:当前类的对象
super:父类的对象
This:可以调用当前类的属性和方法(普通方法和构造方法)
调用普通方法:this.方法名();
调用构造方法:this(); 1)只会在构造方法中调用其他构造方法
2)调用构造方法必须写在当前方法体的第一行
Super:可以调用父类的属性和方法(普通方法和构造方法)
调用普通方法:super.方法名();
调用构造方法:super(); 1、一般方法重写,都会在第一行加上super.重写方法名();
用于对父类方法的过程补充
2、子类的构造方法一定会调用父类的构造方法
用于初始化父类对象,并继承父类对象的属性和方法
3、调用父类构造方法必须写在当前方法体的第一行
- final、insranceof循环判断以及this,super
- Java this&super &final
- this&super&final
- this、super和final
- super.this.static.final
- this,super,static,final
- final,this,super,static
- Super、Final、this关键字
- this、super、final关键字(以及final修饰基本数据类型和引用类型的区别)
- static、this、super、final用法
- static this super final 关键字
- static, super, final, this关键字
- 重写 重载 this super final
- 回忆this,super,static,final
- JAVA :static 、this、super、final
- this super static final关键字
- this super static abstract final
- this,super&final关键字说明
- POJ 2718 贪心
- caffe ubuntu安装全过程 GPU CPU均可参考
- office2007尾注参考文献后添加致谢的方法
- CentOS开启,关闭,查看端口
- 【1】C++读写和显示BMP
- final、insranceof循环判断以及this,super
- 字符串面试题(一)字符串逆序
- Cookie显示上一次的访问时间
- python模块学习---glob 文件路径查找
- 表之顺序结构和链式结构
- css盒子模型的padding的误解
- ExpandableListView详解
- 搜狗安装好,无法输出中文,解决方法。
- linux 内核参数优化