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
相关考题:
若有如下程序: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); } } 结果是什么?()Ax = 2Bx = 5Cx = 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); } } 结果是什么?()AX=6BX=5CX=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); } } 结果是什么?()A55B56C65D66
单选题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); } } 结果为:()A2B3C5D编译失败
单选题现有: 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"); } } } 结果是什么?()AlessB42CdoneD编译失败
单选题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"); } } } 结果为:()A42BdoneCdot =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() + " "); } } 结果是什么?()Ax yyBx,yyCx yy 123Dx,yy,123