社区
Java SE
帖子详情
public static final int MASK_REQUEST = 1 << 0 这个定义是什么意思?
hellotao
2003-02-20 02:27:53
谢谢大家了
...全文
162
4
打赏
收藏
public static final int MASK_REQUEST = 1 << 0 这个定义是什么意思?
谢谢大家了
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
4 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
cno
2003-02-20
打赏
举报
回复
<<是左移位运算符,1就看成是0001,坐移0位后还是0001,坐移1位后是0010,坐移2位后是0100,所以最后REQUEST =1,MASK_MANDATORY=2,MASK_SENT=4,|是或运算符
0001
0010
0100
or
-----------
0111
也就是7
明白了吗?
hellotao
2003-02-20
打赏
举报
回复
public static final int MASK_REQUEST = 1 << 0;
public static final int MASK_MANDATORY = 1 << 1;
public static final int MASK_SENT = 1 << 2;
程序里面用到这个公式是什么意思?
MASK_REQUEST | MASK_OPTIONAL | MASK_SENT
kreven
2003-02-20
打赏
举报
回复
定义常量等于移位后的值
jcq
2003-02-20
打赏
举报
回复
这个就是定义一个int型的常量,值为1。
基于Web的酒店客房管理系统的设计与实现+论文+开题
public
class BaseController {
public
static
final
Long EXPIRES_IN = 1000 * 3600 * 24 * 1L;// 1天 @Autowired private SystemProperties systemProperties; /** * 获得配置文件内容 */
public
String ...
Android的网络与通信
Android平台浏览器采用了WeBKit引擎,这款名为Chorme Lite的Web浏览器拥有强大扩展特性,每个开发者都以为编写自己的插件,使得浏览器的功能更加完善。 目前Android平台有3种网络接口。 第一种 java.net.*...
Windows系统错误代码(Java描述)
public
class WindowsError {
public
static
final
int
ERROR_SUCCESS = 0x0;
public
static
final
int
ERROR_INVALID_FUNCTION = 0x1;
public
static
final
int
ERROR_FILE_NOT_FOUND = 0x2;
public
static
fin
android系统api工具类
public
class SystemManager { private
static
final
String TAG = "fly235";...
public
static
final
int
OP_NONE = -1;
public
static
final
int
OP_COARSE_LOCATION = 0;
public
static
final
int
OP_FINE.
C#版winuser.h
定义
public
class Winuser ...
public
const
int
SB_VERT = 1;
public
const
int
SB_CTL = 2;
public
const
int
SB_BOTH = 3; /* * Scroll Bar Commands */
public
const
int
SB_LINEUP = 0;
public
.
Java SE
62,614
社区成员
307,327
社区内容
发帖
与我相关
我的任务
Java SE
Java 2 Standard Edition
复制链接
扫一扫
分享
社区描述
Java 2 Standard Edition
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章