scip问题-----又送30分!

zgpp 2001-12-21 04:34:43
class sreejith
{
String s;
public static void main(String args[])
{
sreejith ks=new sreejith();
int j,i;
i=ks.hai();
j=ks.hello();
System.out.println(i+" "+j);
}
int hai()
{
if (s==null)|| (s.length()==0))
return 10;
else return 0;
}
int hello()
{
if (s==null)| (s.length()==20))
return 10;
else return 0;
}
}
what will be printed out?
A. 10 10
B. 10 null
C. 0 0ഊD. Compilation Error
E. An Exception in hai
F. An Exception in hello
...全文
88 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
losenetway 2001-12-21
  • 打赏
  • 举报
回复
e,f.
piggyqiu 2001-12-21
  • 打赏
  • 举报
回复
csdn_wangkp 2001-12-21
  • 打赏
  • 举报
回复
答案:d

s并未作初始化,编译出错

62,614

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧