java数据类型

System.out.println(Character.SIZE); //16个字节
System.out.println(Integer.SIZE); //32个字节
System.out.println(Float.SIZE); //32个字节
System.out.println(Double.SIZE); //64个字节
System.out.println(Long.SIZE); //64个字节
System.out.println(BigDecimal.ONE); //不确定

int a=b=4; //错误,在编译到b时找不到被定义的b,因此会报错。

int c=a=b; //正确
int c=5,d=6; //正确

private string cal()
{
string val = "";
for (int i = 1; i <= 30; i++)
{
for (int j = 1; j <= 30-i; j++)
{
int res = i * 3 + j * 2 + 30 - i - j;
if (res == 50)
{
val += "3:" + i + " 2:" + j + " 1:" + (30 - i - j) + " ";
}
}
}
return val;
}

原文地址:https://www.cnblogs.com/lbangel/p/3171083.html