高手指点表达试的问题 请问着个表达式的意思是什么 int result = b == false?1:2; 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 if(b==false)int result=1elseint result=2 int result =((b==false)?1:2)我想这样更清楚 第一步:b==false?1:2 if(b==false) (b==false?1:2)=1else (b==false?1:2)=2第二步:把第一步得出的int型结果赋给result结果:if(b==false) result=1 else result=2 int result=0;if(b==false) { result=1 }else { result=2} 我来帖一个程序 public class text { public int show(boolean b ) { int Resultset= b==false?1:2; return Resultset; } public static void main(String[] args) { text tt=new text(); int i=tt.show(true); System.out.print(i); } } 单例模式怎么理解呢? 新手求助 请教一下哥哥姐姐们一个小问题 请问如何用java实现实时编程? 求解!!!!!!!!!!!!!!!!!!!!!!! 程序修改,我是菜鸟请大家帮忙 ----java中如何调用外部.dll------- 在字符串中找出连续最长的数字串 问一个list控件得问题 OutOfMemoryError,究竟是怎么回事?大侠帮忙(急急急) 急解决的小问题 高分求救 一个小程序 急
int result=1
else
int result=2
if(b==false)
(b==false?1:2)=1
else
(b==false?1:2)=2第二步:
把第一步得出的int型结果赋给result结果:
if(b==false)
result=1
else
result=2
if(b==false)
{
result=1
}
else
{
result=2
}
public class text
{
public int show(boolean b )
{
int Resultset= b==false?1:2;
return Resultset;
}
public static void main(String[] args)
{
text tt=new text();
int i=tt.show(true);
System.out.print(i);
}
}