分析下列Java代码:classA{publicstaticvoidmain(String[]args){method();}staticvoidmethod(){try{System.out.println("Hello");System.exit(0);}finally{System.out.println("good-bye");}}}编译运行后,输出结果是()。
A."Hello"
B."good-bye"
C."Hello"后面是"good-bye"
D.代码不能编译
A."Hello"
B."good-bye"
C."Hello"后面是"good-bye"
D.代码不能编译
A、ArrayIndexOutOfBoundsException
B、NumberFormatException
C、InputMismatchException
D、Exception
A、输出0
B、输出1
C、编译错误
D、运行时出现异常
publiC class Example{
publ ic StatiC VOid main(String args[]){
StatiC int x[]=new int[15]j
System.out.printin(X[5])j
}
)
说法正确的是______。
A.编译时出错 B.运行时出错
C.输出结果为0 D.无输出
A、编译出错
B、运行时抛出异常
C、[608, 610, 612, 629] [608, 610]
D、[608, 610, 612, 629] [608, 610, 629]
E、[606, 608, 610, 612, 629] [608, 610]
F、[606, 608, 610, 612, 629] [608, 610, 629]
import java.io.*; public class ABC { public static void main(String args[]) throws Exception { int i, n = 3, a = 0, b = 0, temp = 0; BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); a = b = Integer.parseInt(br.readLine()); for (i = 0; i <= n; i++) { temp="Integer.parseInt(br.readLine());" if (temp> a) a = temp; if (temp < b) b = temp; } System.out.println("a=" + a + "\nb=" + b); } } 运行代码,输入3↓ 24 ↓ 96↓ 25↓后的输出结果是: 备选答案:A.a=3↓b=96 B. a=96↓b=3 C.a=25↓b=3 D.a=24↓b=25
A、read()
B、available()
C、close()
D、write()
public class Example{
static int X[]=new int[15];
public static void main(String args[]){
System.out.printin(x[5]);
}
}
说法正确的是______。
A.编译时出错 B.运行时出错
C.输出0 D.无输出
A、没有输出任何结果
B、输出结果为3
C、输出结果为3和4
D、输出结果为1、3和4
为了保护您的账号安全,请在“简答题”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!