我编写了一个程序,我想在其中计算幂集大小。但是我无法执行此操作,因为语句 1 的输出是 0?为什么显示错误?
public class PowerSetDemo
{
public static void main(String s[])
{
int q=0;
char a[]={'a','b'};
int p=a.length;
System.out.println(p);
q=2^p; //error here
System.out.println(q); Why 0?
}
}
显示输出 2 0
最佳答案
关于java - 为什么java程序使用^运算符时的输出是这样的?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30610376/