Java简单取反操作

通过取反可以制作简单的文件加密处理器。

示例:

    public static void main(String[] args) throws Exception{
        int i = 3;
        //取反,并且转为字符串
        String str = Integer.toBinaryString(i^0xff);
        System.out.println(str);
    }

运行结果:

 

posted @ 2022-11-22 10:46  在博客做笔记的路人甲  阅读(267)  评论(0编辑  收藏  举报