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

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

import java.util.*;  class ScanStuff {  public static void main(String [] args) {  String s = "x,yy,123";  Scanner sc = new Scanner(s);  while (sc.hasNext())  System.out.print(sc.next() + " ");  }  }  结果是什么?() 

  • A、x yy
  • B、x,yy
  • C、x yy 123
  • D、x,yy,123

参考答案

更多 “ import java.util.*;  class ScanStuff {  public static void main(String [] args) {  String s = "x,yy,123";  Scanner sc = new Scanner(s);  while (sc.hasNext())  System.out.print(sc.next() + " ");  }  }  结果是什么?() A、x yyB、x,yyC、x yy 123D、x,yy,123” 相关考题
考题 若有如下程序:public class Test {public static void main (String[] args) {int x=20;if (x>10) System.out.print(x-=5);if (x>5) System.out.print(x--);}}则程序运行后的输出结果是【 】。

考题 ( 16 )请阅读下面程序import java.io.*;public class TypeTransition {public static void main ( String args[] ){char a = 'a' ;int i = 100 ;long y = 456L ;int aa = a + i ;long yy = y-aa ;System.out.print ( "aa = "+aa ) ;System.out.print ( "yy = ” +yy ) ;}}程序运行结果是A ) as = 197 yy = 259B ) as=77 yy = 259C ) as = 543 yy = 288D ) as = 197 yy = 333

考题 下面程序的输出结果为( )。 public class Test { public static void main (String args[]) { String X="ABCD"; String Y="EFG"; X=X.substring (X.length()-Y.length()); System.out.println(X); } }A.ABCB.BCDC.EFGD.ABCDEFG

考题 请阅读下面程序 import java.io. *; public class TypeTransition { public static void main(String args[]){ char a='a'; int i=l00; long y=456L; int aa=a+i; long yy=y-aa; System.out.print("aa = "+aA.aa=197 yy=259B.aa=177 yy=259C.aa=543 yy=288D.aa=197 yy=333

考题 importjava.util.*;classScanStuff{publicstaticvoidmain(String[]args){Strings=x,yy,123;Scannersc=newScanner(s);while(sc.hasNext())System.out.print(sc.next()+);}}结果是什么?() A.xyyB.x,yyC.xyy123D.x,yy,123

考题 现有:importjava.util.*;classScanStuff{publicstaticvoidmain(String[]args){StringS=x,yy,123;Scannersc=newScanner(s);while(sc.hasNext())System.out.print(sc.next()+);}}结果是什么?() A.xyyB.x,yy,123C.xyy123D.x,yyE.编译失败F.运行的时候有异常抛出

考题 下列程序执行后的结果为______。 public class exl2 { public static void main(string[] args) { int n=4; int x=0; do{ System.out.print(n); }while (x++<n--); } }A.12B.432C.43D.4

考题 interface A{int x = 0;}class B{int x =1;}class C extends B implements A {public void pX(){System.out.println(x);}public static void main(String[] args) {new C().pX();}}

考题 现有:  class Passer f  static final int X=5;  public  static void main (String  []  args)  {      new  Passer().go (x);      System. out .print (x);      }  void go (int x)  {     System. out .print(x++);     }     结果是什么?()     A、55B、56C、65D、66

考题 class Beta {  public static void main(String [] args) {  Integer x = new Integer(6) * 7;  if (x != 42) {  System.out.print("42 ");  } else if (x 〈 new Integer(44-1)) {  System.out.println("less");  } else {  System.out.print("done"); } } }  结果是什么?() A、lessB、42C、doneD、编译失败

考题 import java.util.*;  class Banana3 {  public static void main(String [] args) {  int x = 2;  Banana3 b = new Banana3();  b.go(x);  }  static { x += x; }  void go(int x) {  ++x;  System.out.println(x);  }  }  结果为:()  A、2B、3C、5D、编译失败

考题 现有:  class Top  {     static int X=l;  public Top()  {  x*=3; }     }  class Middle extends Top  {      public  Middle()    {x+=l;  }  public static void main(String  []  args)  {     Middle m=new Middle();    System.out.println (x);    }     }  结果是什么?()    A、  2B、  3C、  4D、编译失败

考题 现有:  class WhileTests  {  public  static void main (String  []  args)  {      int X=5;  while (++x4)  {      --x;     }  System.out.println( "x="+x);      }      } 结果是什么?()     A、X=6B、X=5C、X=2D、编译失败

考题 现有:  import java.util.*;      class  ScanStuff  {  public  static void main (String  []  args)  {     String S= "x,yy,123";  Scanner sc = new Scanner (s);      while  (sc.hasNext())  System.out.print (sc.next()  +" ");     }      }  结果是什么?()     A、  x yyB、 x,yy,123C、  x yy 123D、  x,yyE、编译失败F、运行的时候有异常抛出

考题 class Beta {   public static void main(String [] args) {   Integer x = new Integer(6) * 7;   if (x != 42) {   System.out.print("42 ");   } else if (x.equals(42)) {   System.out.print("dot = ");   } else {   System.out.print("done");   } } }   结果为:()  A、42B、doneC、dot =D、编译失败

考题  public class X {   public static void main (String[]args)   {   string s = new string (“Hello”);   modify(s);   System.out.printIn(s);   }   public static void modify (String s)  {   s += “world!”;      }   }      What is the result?()    A、 The program runs and prints “Hello”B、 An error causes compilation to fail.C、 The program runs and prints “Hello world!”D、 The program runs but aborts with an exception.

考题 class Passer {  static final int x = 5;  public static void main(String [] args) { new Passer().go(x);  System.out.print(x);  }  void go(int x) {  System.out.print(++x);  }  }  结果是什么?() A、55B、56C、65D、66

考题 class WhileTests { public static void main(String [] args) {  int x = 5;  while (++x 〈 3) {  --x;  }  System.out.println("x = " + x);  }  } 结果是什么?()A、x = 2B、x = 5C、x = 6D、编译失败

考题 单选题class WhileTests { public static void main(String [] args) {  int x = 5;  while (++x 〈 3) {  --x;  }  System.out.println("x = " + x);  }  } 结果是什么?()A x = 2B x = 5C x = 6D 编译失败

考题 单选题public class X {   public static void main (String[]args)   {   string s = new string (“Hello”);   modify(s);   System.out.printIn(s);   }   public static void modify (String s)  {   s += “world!”;      }   }      What is the result?()A  The program runs and prints “Hello”B  An error causes compilation to fail.C  The program runs and prints “Hello world!”D  The program runs but aborts with an exception.

考题 单选题现有:  class WhileTests  {  public  static void main (String  []  args)  {      int X=5;  while (++x4)  {      --x;     }  System.out.println( "x="+x);      }      } 结果是什么?()A X=6B X=5C X=2D 编译失败

考题 单选题class Passer {  static final int x = 5;  public static void main(String [] args) { new Passer().go(x);  System.out.print(x);  }  void go(int x) {  System.out.print(++x);  }  }  结果是什么?()A 55B 56C 65D 66

考题 单选题import java.util.*;  class Banana3 {  public static void main(String [] args) {  int x = 2;  Banana3 b = new Banana3();  b.go(x);  }  static { x += x; }  void go(int x) {  ++x;  System.out.println(x);  }  }  结果为:()A 2B 3C 5D 编译失败

考题 单选题现有:  import java.util.*;      class  ScanStuff  {  public  static void main (String  []  args)  {     String S= "x,yy,123";  Scanner sc = new Scanner (s);      while  (sc.hasNext())  System.out.print (sc.next()  +" ");     }      }  结果是什么?()A   x yyB  x,yy,123C   x yy 123D   x,yyE 编译失败F 运行的时候有异常抛出

考题 单选题class Beta {  public static void main(String [] args) {  Integer x = new Integer(6) * 7;  if (x != 42) {  System.out.print("42 ");  } else if (x 〈 new Integer(44-1)) {  System.out.println("less");  } else {  System.out.print("done"); } } }  结果是什么?()A lessB 42C doneD 编译失败

考题 单选题class Beta {   public static void main(String [] args) {   Integer x = new Integer(6) * 7;   if (x != 42) {   System.out.print("42 ");   } else if (x.equals(42)) {   System.out.print("dot = ");   } else {   System.out.print("done");   } } }   结果为:()A 42B doneC dot =D 编译失败

考题 单选题import java.util.*;  class ScanStuff {  public static void main(String [] args) {  String s = "x,yy,123";  Scanner sc = new Scanner(s);  while (sc.hasNext())  System.out.print(sc.next() + " ");  }  }  结果是什么?()A x yyB x,yyC x yy 123D x,yy,123