我制作了一个程序,我想在其中计算功率集大小。但我无法做到,因为语句 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