网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

switch(x) {  default:  System.out.println(“Hello”);  }  Which two are acceptable types for x?() 

  • A、 byte
  • B、 long
  • C、 char
  • D、 float
  • E、 Short
  • F、 Long

参考答案

更多 “ switch(x) {  default:  System.out.println(“Hello”);  }  Which two are acceptable types for x?() A、 byteB、 longC、 charD、 floatE、 ShortF、 Long” 相关考题
考题 下面程序的输出结果是( )。 public class Sun { public static void main(String args[ ]) { int i = 9; switch (i) { default: System.out.println("default"); case 0: System.out.println("zero"); break; case 1: System.out.println("one"); case 2: System.out.println("two"); } } }A.defaunB.defauh, zeroC.error default clause not definedD.no output displayed

考题 下面程序的输出结果是( )。 public class Sun { public static void main(String args[ ]) { int i = 1; switch (i) { case 0: System.out.println("zero"); break; case 1: System.out.println("one"); case 2; System.out.println("two"); default: System.out.println("default"); } } }A.oneB.one,defaultC.one,two,defaultD.default

考题 给出下面程序段if(x>0){System.out.println“Hello.“;}elseif(x>-3){System.out.println“Nicetomeetyou“;}else{System.out.println“Howareyou“;}若打印字符串“Howareyou”,则x的取值范围是()。 A.x>0B.x>-3C.xD.x-3

考题 publicclassBar{11.staticvoidfoo(int...x){12.//insertcodehere13.}14.}Which two code fragments,inserted independently at line1 2,will allow the class to compile() A.foreach(x)System.out.println(z);B.for(intz:x)System.out.println(z);C.while(x.hasNext())System.out.println(x.next());D.for(inti=0;i

考题 switch(i){default:System.out.printIn(Hello”);}Whatistheacceptabletypeforthevariablei?() A.ByteB.LongC.FloatD.DoubleE.ObjectF.AandBG.CandD

考题 switch(x){default:System.out.println(“Hello”);}Whichtwoareacceptabletypesforx?() A.byteB.longC.charD.floatE.ShortF.Long

考题 下面程序的输出结果是( )。 public class Sun { public static void main(String args[ ]) { int i = 1; switch (i) { case 0: System.but.println("zero"); break; case 1: System.out.println("one"); case 2: System.out.println("two"); default: System.out.println ("default"); } } }A.oneB.one, defaultC.one, two, defaultD.default

考题 编译和执行以下代码,输出结果是( )。 int i=1; switch (i) { case 0: System.out.print("zero,"); break; case 1: System.out.print("one,"); case 2: System.out.print("two,"); default: System.out.println("default"); }A.one,B.one,two,C.one,two,defaultD.default

考题 给出下面程序段: if(x>0){System.out.println("Hello.");} else if(x>-3){ System.out.println("Nice to meet you!");} else{System.out.println("How are you?");} 若打印字符串"How are yoh?",则x的取值范围是( )。A.x>0B.x>-3C.x≤-3D.x≤0x>-3

考题 以下程序段的输出结果为( )。 int j=2 switch (j){ Case 2: system.out.print("two."): Case 2+1: System.out.println("three."); break: default: System.out.println (“value is”+j): Break }A.B.twoA.two.three.B.twoC.threeD.value is 2

考题 若有定义语句int a,b;double x;则下列选项中没有错误的是( )。A.switch(x%2) {case O:a++;break; case 1:b++;break; default:a++;b++; }B.switch((int)x/2.0) {case O:a++;break; case 1:b++;break; default:a++;b++; }C.switch((int)x%2) {case O:a++;break; case 1:b++;break; default:a++;b++; }D.switch((int)(x)%2) {case 0.O:a++;break; case 1.0:b++;break; default:a++;b++; }

考题 关于以下程序哪条叙述正确?1. int j = 2;2. switch ( j ) {3. case 2:4. System.out.println ("value is two");5. case 2 + 1:6. System.out.println ("value is three");7. break;8. default:9. System.out.println("value is " + j);10. break;11. }A. 第5行的表达式不合法;B. 变量j是可接受的,switch中表达式可以是byte, short, int,或long的任何类型;C. 输出为value is twoD. 输出是value is two 后跟value is threeE. 输出是value is two 后跟 value is 2

考题 有如下代码段:switch ( x ){case 1:System.out.println("One");break;case 2:case 3:System.out.println("Two");break;default:System.out.println("end");}变量x的取值下列哪些情形时,能使程序输出"Two" 。A. 1B. 2C. 3D. default

考题 10. public class Bar {  11.static void foo(int...x) {  12. // insert code here  13. }  14. }  Which two code fragments, inserted independently at line 12, will allow the class to compile?()A、 foreach(x) System.out.println(z);B、 for(int z : x) System.out.println(z);C、 while( x.hasNext()) System.out.println( x.next());D、 for( int i=0; i x.length; i++ ) System.out.println(x[i]);

考题 有如下定义:inta=1;byteb=2;则表达式a+b的数据类型为()A、intB、byteC、charD、long

考题 switch (i) {   default:  310-025   Leading the way in IT testing and certification tools,www.testking.com   - 27 -  System.out.printIn(“Hello”);  }   What are the two acceptable types for the variable i? ()A、 CharB、 ByteC、 FloatD、 DoubleE、 Object

考题 switch (i)  {  default:  System.out.printIn(“Hello”);  )   What are the two acceptable types for the variable i?()  A、 CharB、 ByteC、 FloatD、 DoubleE、 Object

考题 Which fragment is an example of inappropriate use of assertions? ()A、 assert (!(map.contains(x))); map.add(x);B、 if (x  0){}else { assert (x==0); }C、 public void aMethod(int x) { assert (x  0); }D、 assert (invariantCondition()); return retval;E、 switch (x) { case 1: break; case 2: creak; default: assert (x == 0);

考题 switch (i) {  default:   System.out.printIn(“Hello”);   }  What is the acceptable type for the variable i?()  A、 ByteB、 LongC、 FloatD、 DoubleE、 ObjectF、 A and BG、 C and D

考题 Which two data types can be converted to LOBs using an ALTER TABLE… MODIFY command?()A、RAWB、LONGC、VARCHARD、LONG RAW

考题 You have set the value of the NLS_TIMESTAMP_TZ_FORMAT parameter in the parameter file to YYYY/x7fMM/x7fDD. The default format of which two data types would be affected by this setting?()A、DATEB、TIMESTAMPC、INTERVAL YEAR TO MONTHD、INTERVAL DAY TO SECONDE、TIMESTAMP WITH LOCAL TIME ZONE

考题 多选题You have set the value of the NLS_TIMESTAMP_TZ_FORMAT parameter in the parameter file to YYYY/x7fMM/x7fDD. The default format of which two data types would be affected by this setting?()ADATEBTIMESTAMPCINTERVAL YEAR TO MONTHDINTERVAL DAY TO SECONDETIMESTAMP WITH LOCAL TIME ZONE

考题 单选题switch (i)  {  default:  System.out.printIn(“Hello”);  }  What is the acceptable type for the variable i?()A  ByteB  LongC  FloatD  DoubleE  ObjectF  A and BG  C and D

考题 多选题switch (i) {   default:  310-025   Leading the way in IT testing and certification tools,www.testking.com   - 27 -  System.out.printIn(“Hello”);  }   What are the two acceptable types for the variable i? ()ACharBByteCFloatDDoubleEObject

考题 多选题switch (i)  {  default:  System.out.printIn(“Hello”);  )   What are the two acceptable types for the variable i?()ACharBByteCFloatDDoubleEObject

考题 多选题switch(x) {  default:  System.out.println(“Hello”);  }  Which two are acceptable types for x?()AbyteBlongCcharDfloatEShortFLong

考题 单选题Which fragment is an example of inappropriate use of assertions? ()A  assert (!(map.contains(x))); map.add(x);B  if (x  0){}else { assert (x==0); }C  public void aMethod(int x) { assert (x  0); }D  assert (invariantCondition()); return retval;E  switch (x) { case 1: break; case 2: creak; default: assert (x == 0);