package scanner; public class SingleAnd { public static void main(String[] args) { int[] first = {10,15,8,5,0}; int[] second = {4,8,1,2}; int result = 0; for(int i=0; i<first.length; i++){ for(int j=0; j<second.length; j++){ result = first[i] &…
博客大搬家. 一.位运算符简介: 1.按位与&.如果两个整形数据 a.b 对应位都是1,则结果位才为1,否则为0,(int 最大值0x7fffffff ): int a = 0x7fffffff; int b = 12; int c = 0; int aAndB = a&b; // aAndB is 12 int aAndC = a&c; // aAndC is 0 2.按位或|.如果两个操作数都是0,则结果为0,否则为1: int a = 0x7fffffff; int b…
package com.per.sdg.operator; /** * 结论:先进行'&&'运算,在进行'||'运算 * @author sundg * */ public class AndOrDemo { public static void main(String[] args) { int a=1; int b=3; int c=5; boolean d=true; System.out.println(a>b||c>b&&d);//==>F||T…