单项选择题
public class Test {}
What is the prototype of the default constructor?()
A. Test()
B. Test(void)
C. public Test()
D. public Test(void)
E. public void Test()
点击查看答案&解析
相关考题
-
单项选择题
try { int x = 0; int y = 5 / x; } catch (Exception e) { System.out.println(“Exception”); } catch (ArithmeticException ae) { System.out.println(“Arithmetic Exception”); } System.out.println(“finished”); What is the result?()
A. finished
B. Exception
C. Compilation fails.
D. Arithmetic Exception -
单项选择题
int i = 0; while (true) { if(i==4) { break; } ++i; } System.out.println(“i=”+i); What is the result?()
A. i = 0
B. i = 3
C. i = 4
D. i = 5
E. Compilation fails. -
单项选择题
1. public class Exception Test { 2. class TestException extends Exception {} 3. public void runTest() throws TestException {} 4. public void test() /* Point X */ { 5. runTest(); 6. } 7. } At Point X on line 4, which code is necessary to make the code compile?()
A. No code is necessary.
B. throws Exception
C. catch ( Exception e )
D. throws RuntimeException
E. catch ( TestException e)
