& 0xFF的意思

最近看见一段代码如下:

    public final short Red;
    public final short Green;
    public final short Blue;

    public ZLColor(int r, int g, int b) {
        Red = (short)(r & 0xFF);
        Green = (short)(g & 0xFF);
        Blue = (short)(b & 0xFF);
    }

我承认我没用过,自己查阅的时候相关资料也很少,最后找到一份资料。涨知识了,同时这里记录一下

猜你喜欢

转载自blog.csdn.net/u014769864/article/details/78908212