public class Yippee { public static void main(String [] args) { for(int x = 1; x
A: No output is produced. 123
B: No output is produced. 234
C: No output is produced. 1234
D: An exception is thrown at runtime. 123
E: An exception is thrown at runtime. 234
F: An exception is thrown at rijntime. 1234
A: No output is produced. 123
B: No output is produced. 234
C: No output is produced. 1234
D: An exception is thrown at runtime. 123
E: An exception is thrown at runtime. 234
F: An exception is thrown at rijntime. 1234
举一反三
- 下面程序的输出为( )。 public class Test { public static void main (String args[]) { int x,y; x=1; y=2; System.out.println("The output is"+x+y); } } A: The output is xy B: The output is 3 C: The output is 12 D: The output is x=1 y=2
- class Demo{ public static void main(String[] args){ int x = 0; try{ x = div(1,2); }catch(Exception e){ System.out.println(e); } System.out.println(x) ; } public static int div(int a,int b){ return a / b ; } }
- import java.io.IOException; public class ExceptionTest( public static void main (String[]args) try ( methodA(); ) catch (IOException e) ( system.out.printIn(“Caught IOException”); ) catch (Exception e) ( system.out.printIn(“Caught Exception”); ) ) public void methodA () { throw new IOException (); } What is the result?() A: The code will not compile. B: The output is caught exception. C: The output is caught IOException. D: The program executes normally without printing a message.
- What will be the output of the following Python code? ( )[img=339x165]17d6037e17803e7.png[/img] A: 5 B: An exception is thrown C: 1 D: 4
- System.out.println(Math.sqrt(-4D)); What is the result?() A: –2 B: NaN C: Infinity D: Compilation fails. E: An exception is thrown at runtime.