【单选题】【消耗次数: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( )
随机题目
【单选题】 居民储蓄存款是居民(  )扣除消费支出以后形成的。
①  总收入
②  工资收入
③  可支配收入
④  税前收入
【单选题】 (  )是指中央银行通过道义劝告、窗口指导等办法来间接影响商业银行等金融机构行为的做法。
①  再贴现率
②  间接信用指导
③  法定存款准备金率
④  公开市场业务
【单选题】 在道—琼斯指数中,公用事业类股票取自(  )家公用事业公司。
①  6
②  10
③  15
④  30
【单选题】 企业的利润虽然增长很快,但所面临的竞争风险也非常大,破产率与被兼并率相当高的时期是企业的(  )。
①  幼稚期
②  成长期
③  成熟期
④  衰退期
【单选题】 所谓“摩尔定律”,即微处理器的速度会(  )翻—番,同等价位的微处理器的计算速度会越来越快,同等速度的微处理器会越来越便宜。
①  每6个月
②  每12个月
③  每18个月
④  每24个月
【单选题】 下列不属于上市公司区位分析的是(  )。
①  区位内的自然和基础条件
②  区位内政府的产业政策
③  行业地位分析
④  区位内的经济特色
【单选题】 某公司年初净资产为800万元,年末净资产为1000万元,税息前利润为200万元,税后利息费用为40万元,公司所得税为25%,请问公司的资产净利率为(  )。
①  13%
②  10%
③  14%
④  12%
【单选题】 属于试探性的多元化经营的开始和策略性投资的资产重组方式是(  )。
①  收购公司
②  收购股份
③  公司合并
④  购买资产
【单选题】 (  )是技术分析的理论基础。
①  道氏理论
②  波浪理论
③  形态理论
④  黄金分割理论
【单选题】 趋势线被突破说明(  )。
①  股价会上升
②  股价走势将要反转
③  股价走势将加速
④  股价会下降