查题网
高校
河南理工大学
截止11-14,该科目累计收录道题目。
返回课程列表
11[分析题] 下面程序是否有错?如果有错试标出错误位置并指出是何种错误。 public static void main(String args[ ]) { try{ char ch=(char)System.in.read(); . . .//其他语句 } catch(Exception e) { return; } catch(IOException e) { System.out.println(e.toString(); } }
查看答案
2022-01-08 01:53:19
6[分析题] 下面程序是否有错?如果有错试标出错误位置并指出是何种错误。 public class MyMain { public static void main(String args[ ]) { System.out.println(MyClass1.data);} } class MyClass1 { int data=10; }
查看答案
2022-01-08 01:52:19
7[分析题] 下面程序是否有错?如果有错试标出错误位置并指出是何种错误。 class IamAbstract { final int f; double d; abstract void method(); }
查看答案
2022-01-08 01:52:19
8[分析题] 下面程序是否有错?如果有错试标出错误位置并指出是何种错误。 class parent { private int mine; } class child extends parent { int getMine() { return mine; } }
查看答案
2022-01-08 01:52:19
3[分析题] 下面程序是否有错?如果有错试标出错误位置并指出是何种错误。 程序: class c { static int x = 20; int y = 30; static int plus() { return x y; } public static void main(String [] args ) { int result = plus(); System.out.println(“result = “ result);
查看答案
2022-01-08 01:51:19
4[分析题] 下面程序是否有错?如果有错试标出错误位置并指出是何种错误。 class MyClass { int var=100; static int getVar() { return var; } }
查看答案
2022-01-08 01:51:19
5[分析题] 下面程序是否有错?如果有错试标出错误位置并指出是何种错误。 public class MyClass { int data; void MyClass(int d) { data=d;} }
查看答案
2022-01-08 01:51:19
1[分析题] 试写出下面这个程序的执行结果. class ExceptionTest { static String a[] = {"123", "abc", null}; public static void main (String args[]) { for (int i = 0; i < 3; i ) { try { int x = Integer.parseInt(a[i]); System.out.println( "Result: " x); } catch(NullPointerException e) { System.out.println("error null:");} catch (NumberFormatException e) {System.out.println("error:abc" );} finally{System.out.println ("In " i "th loop "); } } //end for } }
查看答案
2022-01-08 01:50:19
2[分析题] 下面程序是否有错?如果有错试标出错误位置并指出是何种错误。 程序: class ArraySum { int a[3] = { 2, 4, 8}; int sum () { int s=0; for (int i = 0; i < 3; i ) s = s a[i]; return s; } }
查看答案
2022-01-08 01:50:19
27[简答题] 什么是方法的覆盖?
查看答案
2022-01-08 01:49:19
首页
上一页
...
580
581
582
(current)
583
584
...
下一页
尾页