【单选题】【消耗次数: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( )
随机题目
【单选题】 4.“金羊毛”的故事发生在()英雄传说。
①  伊阿宋
②  赫拉克勒斯
③  阿伽门农
④  俄狄浦斯
【单选题】 7.歌德的《浮士德》共描写了浮士德()个阶段的悲剧。
①  5
②  4
③  3
④  2
【单选题】 4.卢梭的教育小说是()。
①  《爱弥儿》
②  《天真汉》
③  《新爱洛依丝》
④  《忏悔录》
【单选题】 5.英国的启蒙文学以()小说为最高。
①  教育
②  哲理
③  现实主义
④  自传
【单选题】 9.德国文学史上第一部具有国际影响的作品是()。
①  《少年维特之烦恼》
②  《浮士德》
③  《赫尔曼与窦绿台》
④  《诗与真》
【单选题】 3.“百科全书派”的领袖狄德罗在启蒙文学上积极提倡()。
①  悲剧
②  喜剧
③  市民剧
④  荒诞剧
【单选题】 1.法国启蒙运动中最具有领袖威望的作家是()。
①  孟德斯鸠
②  伏尔泰
③  狄德罗
④  卢梭
【单选题】 10.被恩格斯称之为“辩证法的杰作”的作品是()。
①  《浮士德》
②  《少年维特之烦恼》
③  《亲和力》
④  《赫尔曼与窦绿台》
【单选题】 6.英国现实主义小说的开山之作是()。
①  《鲁滨逊漂流记》
②  《汤姆 琼斯》
③  《感伤旅行》
④  克拉丽丝
【单选题】 4.清教徒作家约翰班扬的代表作是()。
①  《天路历程》
②  《失乐园》
③  《复乐园》
④  《力士参孙》