填空题
本题定义了一个求两个数的最大值的方法max,并调用该方法计算67和23的最大值。
public class javal
public static void main(String[]args)
javal temp=new javal();
int res=max(67,23);
System.out.println("res="+res);
static int max(______)
int maxNum;
if(a<b)
______;
else
maxNum=b;
______;
【参考答案】
第A处:int a,int b
第B处:maxNum=a
第C处:return maxNum
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
单项选择题
下列程序的功能是在监控台上每隔一秒钟显示一个字符串 Hello! ,能够填写在程序中下画线位置,使程序完整并能正确运行的语句是______。 public class Test implements Runnable public static void main(String args[]) Test t=new Test(); Threadt t=new Thread(t); tt.start(); public void run() for(;;) try _______; ﹜catch(______e) System.out.println( Hello );
A.sleep(1000)
B.t.sleep(1000)
InterruptedExceptionInterruptedException
C.Thread.sleep(1000)D.Thread.sleep(1000)
RuntimeExceptionInterruptedException
点击查看答案&解析
单项选择题
阅读下列代码后 public class Person int arr[]=new int[10]; public static void main(String args[]) System.out.println(arr[1]); 正确的说法是______。
A.编译时将产生错误
B.编译时正确,运行时将产生错误
C.输出零
D.输出空
点击查看答案&解析
相关试题
本题的功能是定义自己的组件类。窗口中排布...
本题的功能是对下拉菜单项的操作,包括添加...