21.>>和<<和instance of
来源:互联网 发布:js json数据格式转换 编辑:程序博客网 时间:2024/05/22 09:43
>>
右移一位。相当于除2
<<
左移一位。相当于乘2
public static void main(String[] args) {int a=3<<2;int b=12>>2;System.out.println("a="+a);System.out.println("b="+b);}
解析:
a=3*2*2=12
b=12/2/2=3
运行结果:
a=12
b=3
Java 中的instance of 运算符是用来在运行时指出对象是否是特定类的一个实例。instanceof通过返回一个布尔值来指出,这个对象是否是这个特定类或者是它的子类的一个实例。
用法:
result = object instance of class
参数:
Result:布尔类型。
Object:必选项。任意对象表达式。
Class:必选项。任意已定义的对象类。
说明:
如果 object 是 class 的一个实例,则 instance of 运算符返回 true。如果 object 不是指定类的一个实例,或者 object 是 null,则返回 false。
0 0
- 21.>>和<<和instance of
- isInstance(Object)和instance of的区别
- new 和 Instance区别
- instance和media损坏恢复
- Java中instance和instanceof
- instance和id的区别
- python中type和instance
- instance和typeof 使用 十九
- Instance Segmentation 和 Semantic Segmentation
- Java中instance和instanceof
- javascript中的instance和typeof
- Dialog instance和Gateway Instance是做什么用的?
- JavaScript的Static Variable和Instance Property
- new Instance()方法和new关键
- oracle查询DBname 和 hostname(instance)
- object-c之instance variables和property
- Oracle 中 instance和database的区别
- Objective-C property和instance variable
- 输入年和月份,输出这一年该月份有多少天。
- SpringBoot文件上传
- 用QML实现简单音视频播放器的实践
- WIN7安装bugzilla报错 couldn't create child process: 720002: index.cgi
- jquery获取复选框的值
- 21.>>和<<和instance of
- mysql如何提高其查询速度的方法
- struts2 action
- shell脚本中echo显示内容带颜色的实现方法
- 大数据个人学习规划
- [C语言]常用关键字
- OpenCV使用FileStorage读写Mat数据(学习笔记)
- 开源软件架构-ZeroMQ
- CustomDialog