【单选题】【消耗次数:1】
下面哪一行代码正确的声明了一个类方法(静态方法)?( )
public int method(int i)
protected method(int i)
public static method(String s)
protected static void method(Integer i)
参考答案:
复制
纠错
相关题目
【单选题】 下面哪个函数是public void method(){ }的重载函数?( )
①  public void method( int m){ }
②  public int method(){ }
③  public void method2(){ }
④  public int method(int m,float f ){ }
【单选题】 已知有下面类的说明: public class X5_1_1 extends x{ private float f =10.6f; int i=16; static int si=10; public static void main(String[] args) { X5_1_1 x=new } } X5_1_1(); 在 main()方法中,下面哪条语句的用法是正确的?( )
①  x.f
②  this.si
③  X5_1_1.i
④  X5_1_1.f
【单选题】 运行下面程序时,会产生什么异常?( ) public class X7_1_4 { public static void main(String[] args) { int x = 0; int y = 5/x; int[] z = { 1,2,3,4 } ; int p = z[4]; } }
①  ArithmeticException
②  NumberFormatException
③  ArrayIndexOutOfBoundsException
④  IOException
【单选题】 运行下面程序时,会产生什么异常?( ) public class X7_1_5 { public static void main(String[] args) { int[] z = { 1,2,3,4 } ; int p = z[4]; int x = 0; int y = 5/x; } }
①  ArithmeticException
②  NumberFormatException
③  ArrayIndexOutOfBoundsException
④  IOException
【单选题】 给出下面代码段, 哪行将引起一个编译时错误?( ) 1) public class Test { 2) int n = 0; 3) int m = 0; 4) public Test(int a) { m=a; } 5) public static void main(String arg[]) { 6) Test t1,t2; 7) int j,k; 8) j=3; k=5; 9) t1=new Test(); 10) t2=new Test(k); 11) } 12) }
①  行1
②  行4
③  行6
④  行9
【单选题】 有以下程序,程序执行后的输出结果是( ) #include int fun(int x [ ],int n) { static int sum=0,i; for(i=0; i{ sum+=x[i]; } return sum; } void main( ) { int a[ ]={1,2,3,4,5}; int b[ ]={6,7,8,9},s=0; s=fun(a,5)+fun(b,4); printf(%d\n,s); }
①  45
②  50
③  60
④  66
【单选题】 下面的方法,当输入为2的时候返回值是多少?( ) public int getValue(int i) { int result = 0; switch (i) { case 1: result = result + i; case 2: result = result + i * 2; case 3: result = result + i * 3; } return result; }
①  0
②  2
③  4
④  10
【单选题】 Which of the following is not grammar presentation method?
①  Deductive method
②  Inductive method
③  Guided discovery method
④  Communicative teaching method.
【单选题】 阅读以下代码: import java.io.*; import java.util.*; public class foo{ public static void main (String[] args){ String s; System.out.println(s= + s); } } 输出结果应该是:( )
①  代码得到编译,并输出“s=”
②  代码得到编译,并输出“s=null”
③  由于String s没有初始化,代码不能编译通过
④  代码得到编译,但捕获到 NullPointException异常
【单选题】 为AB类的一个无形式参数无返回值的方法method书写方法头,使得使用类名AB作为前缀就可以调用它,该方法头的形式为( )。
①  static void method( )
②  public void method( )
③  final void method( )
④  abstract void method( )
随机题目
【判断题】 变压器空载运行时的功率是视在功率?
①  正确
②  错误
【判断题】 变压器并联运行时,短路阻抗标幺值小的变压器先达到满载吗?
①  正确
②  错误
【判断题】 异步电动机中的主磁场是旋转磁场?
①  正确
②  错误
【判断题】 极限偏差大的零件,其公差值一定大。
①  正确
②  错误
【判断题】 公差等级的选用应在保证使用要求的条件下,尽量选取较低的公差等级。
①  正确
②  错误
【判断题】 当相互配合的孔、轴既要求对准中心,又要求装拆方便时,应选用间隙配合。
①  正确
②  错误
【判断题】 直线度公差带一定是距离为公差值t的两平行平面之间的区域,
①  正确
②  错误
【判断题】 实际测量得到的提取尺寸就是尺寸的真值。
①  正确
②  错误
【判断题】 工作量规“止规”用来控制工件的的最小实体尺寸。
①  正确
②  错误
【单选题】 Φ30H8/r8与Φ30R8/h8的配合性质()。
①  相同 ;
②  不相同
③  无法确定