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

题目

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”相关问题
  • 第1题:

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

    A.xyy

    B.x,yy

    C.xyy123

    D.x,yy,123


    参考答案:D

  • 第2题:

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

    A.12

    B.432

    C.43

    D.4


    正确答案:B

  • 第3题:

    现有:  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、55
    • B、56
    • C、65
    • D、66

    正确答案:A

  • 第4题:

    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、2
    • B、3
    • C、5
    • D、编译失败

    正确答案:D

  • 第5题:

    现有:  class WhileTests  {  public  static void main (String  []  args)  {      int X=5;  while (++x<4)  {      --x;     }  System.out.println( "x="+x);      }      } 结果是什么?()     

    • A、X=6
    • B、X=5
    • C、X=2
    • D、编译失败

    正确答案:A

  • 第6题:

    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、42
    • B、done
    • C、dot =
    • D、编译失败

    正确答案:C

  • 第7题:

    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、55
    • B、56
    • C、65
    • D、66

    正确答案:C

  • 第8题:

    单选题
    class WhileTests { public static void main(String [] args) {  int x = 5;  while (++x 〈 3) {  --x;  }  System.out.println("x = " + x);  }  } 结果是什么?()
    A

    x = 2

    B

    x = 5

    C

    x = 6

    D

    编译失败


    正确答案: D
    解析: 暂无解析

  • 第9题:

    单选题
    现有:  class WhileTests  {  public  static void main (String  []  args)  {      int X=5;  while (++x<4)  {      --x;     }  System.out.println( "x="+x);      }      } 结果是什么?()
    A

    X=6

    B

    X=5

    C

    X=2

    D

    编译失败


    正确答案: A
    解析: 暂无解析

  • 第10题:

    单选题
    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

    2

    B

    3

    C

    5

    D

    编译失败


    正确答案: C
    解析: 暂无解析

  • 第11题:

    单选题
    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

    less

    B

    42

    C

    done

    D

    编译失败


    正确答案: C
    解析: 暂无解析

  • 第12题:

    单选题
    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


    正确答案: B
    解析: 暂无解析

  • 第13题:

    现有:importjava.util.*;classScanStuff{publicstaticvoidmain(String[]args){StringS="x,yy,123";Scannersc=newScanner(s);while(sc.hasNext())System.out.print(sc.next()+"");}}结果是什么?()

    A.xyy

    B.x,yy,123

    C.xyy123

    D.x,yy

    E.编译失败

    F.运行的时候有异常抛出


    参考答案:B

  • 第14题:

    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();

    }

    }


    正确答案:

     

    错误。在编译时会发生错误(错误描述不同的JVM 有不同的信息,意思就是未明确的

    x 调用,两个x 都匹配(就象在同时import java.util 和java.sql 两个包时直接声明Date 一样)。

    对于父类的变量,可以用super.x 来明确,而接口的属性默认隐含为 public static final.所以可

    以通过A.x 来明确。

  • 第15题:

    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、less
    • B、42
    • C、done
    • D、编译失败

    正确答案:A

  • 第16题:

    现有:  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、  2
    • B、  3
    • C、  4
    • D、编译失败

    正确答案:C

  • 第17题:

    现有:  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,123
    • C、  x yy 123
    • D、  x,yy
    • E、编译失败
    • F、运行的时候有异常抛出

    正确答案:B

  • 第18题:

     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.

    正确答案:A

  • 第19题:

    class WhileTests { public static void main(String [] args) {  int x = 5;  while (++x 〈 3) {  --x;  }  System.out.println("x = " + x);  }  } 结果是什么?()

    • A、x = 2
    • B、x = 5
    • C、x = 6
    • D、编译失败

    正确答案:C

  • 第20题:

    单选题
    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.


    正确答案: B
    解析: 暂无解析

  • 第21题:

    单选题
    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

    55

    B

    56

    C

    65

    D

    66


    正确答案: D
    解析: 暂无解析

  • 第22题:

    单选题
    现有:  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,123

    C

      x yy 123

    D

      x,yy

    E

    编译失败

    F

    运行的时候有异常抛出


    正确答案: C
    解析: 暂无解析

  • 第23题:

    单选题
    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

    42

    B

    done

    C

    dot =

    D

    编译失败


    正确答案: D
    解析: 暂无解析