【单选题】【消耗次数: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( )
随机题目
【单选题】 在销售量不变的情况下,保本点越高,能实现的利润()。
①  不变
②  越多
③  越少
④  不确定
【单选题】 关于盈亏临界点,下列说法不正确的是( )。
①  如果在此基础上,增大销售量,企业将开始盈利
②  企业此时不盈不亏,利润为0
③  销售收入线与总成本线的交点即为盈亏临界点
④  此时企业利润达到最大
【单选题】 ( )是职业礼仪的核心,对任何交往对象都必须一视同仁,给予同等程度的礼遇。
①  平等原则
②  宽容原则
③  自律原则
④  敬人原则
【单选题】 尊重自己的服务对象,讲求职业礼仪,与企业、组织在公众心目中的地位是无关的。
① 
② 
【单选题】 把为集体,为他人工作放在首位,这属于()。
①  无私奉献
②  以上都不是
③  服务第一
④  爱岗敬业
【单选题】 “阿姨,没什么事,给您打个电话,祝你身体健康”,属于()。
①  衷心祝福法
②  快乐分享法
③  表达挂念法
④  节日祝福法
【单选题】 向寿星献祝寿词,顺序一般为:先是寿星晚辈,后是有关亲戚,最后是无亲戚关系的朋友、同事等。
① 
② 
【单选题】 老年婚姻介绍服务的第一步为()。
①  以上都不是
②  合意人选
③  信息比对
④  个人信息采集和登记
【单选题】 自我暴露也叫自我开放或者自我表露。
① 
② 
【单选题】 完成销售后进入付款阶段,付款前最好是跟老人家属再次确认后再收费。
① 
②