单选题Given: 12.String csv = "Sue,5,true,3"; 13.Scanner scanner = new Scanner( csv ); 14.scanner.useDelimiter(",");15. int age = scanner.nextInt(); What is the result?()ACompilation fails.BAfter line 15, the value of age is 5.CAfter line 15, the value of age is 3.DAn exception is thrown at runtime.

单选题
Given: 12.String csv = "Sue,5,true,3"; 13.Scanner scanner = new Scanner( csv ); 14.scanner.useDelimiter(",");15. int age = scanner.nextInt(); What is the result?()
A

Compilation fails.

B

After line 15, the value of age is 5.

C

After line 15, the value of age is 3.

D

An exception is thrown at runtime.


参考解析

解析: 暂无解析

相关考题:

public static void main(String[]args){12.Object obj=new int[]{1,2,3};13.int[] someArray=(int[])obj;14.for(inti:someArray)System.out.print(i+)15.}What is the result?() A.123B.Compilation fails because of an error in line 12.C.Compilation fails because of an error in line 13.D.Compilation fails because of an error in line 14.E.A ClassCastException is thrown at runtime.

Stringcsv=Sue,5,true,3”;13.Scannerscanner=newScanner(csv);14.scanner.useDelimiter(”,”);15.intage=scanner.nextInt();Whatistheresult?() A.Compilationfails.B.Afterline15,thevalueofageis5.C.Afterline15,thevalueofageis3.D.Anexceptionisthrownatruntime.

Given:12.Stringcsv=Sue,5,true,3;13.Scannerscanner=newScanner(csv);14.scanner.useDelimiter(,);15.intage=scanner.nextInt();Whatistheresult?() A.Compilationfails.B.Afterline15,thevalueofageis5.C.Afterline15,thevalueofageis3.D.Anexceptionisthrownatruntime.

11. public static void main(String[] args) {  12. Object obj =new int[] { 1,2,3 };  13. int[] someArray = (int[])obj;  14. for (int i: someArray) System.out.print(i +“ “)  15. }  What is the result? ()A、 1 2 3B、 Compilation fails because of an error in line 12.C、 Compilation fails because of an error in line 13.D、 Compilation fails because of an error in line 14.E、 A ClassCastException is thrown at runtime.

public class test (    public static void main (String args) {    int i = 0xFFFFFFF1;  int j = ~i;   }    )   What is the decimal value of j at line 5?()A、 0B、 1C、 14D、 –15E、 An error at line 3 causes compilation to fail.F、 An error at line 4 causes compilation to fail.

class Super {  public int getLenght( ) { return 4; }  }  public class Sub extends Super {  public long getLenght( ) { return 5; }  public static void main(String[] args) {  Super sooper = new Super( );  Sub sub = new Sub( );  System.out.println(  sooper.getLenght( ) + “,” + sub.getLenght( ) );  }  } What is the output?()A、 Just after line 13.B、 Just after line 14.C、 Just after line 15.D、 Just after line 16 (that is, as the method returns).

1. public class Boxer1 {  2. Integer i;  3. int x;  4. public Boxer1(int y) {  5. x=i+y;  6. System.out.println(x);  7. }  8. public static void main(String[] args) {  9. new Boxer1(new Integer(4));  10. }  11. }  What is the result?() A、 The value “4” is printed at the command line.B、 Compilation fails because of an error in line 5.C、 Compilation fails because of an error in line 9.D、 A NullPointerException occurs at runtime.E、 A NumberFormatException occurs at runtime.F、 An IllegalStateException occurs at runtime.

11.public static void main(String[]args){ 12.Object obj=new int[]{1,2,3}; 13.int[] someArray=(int[])obj; 14.for(inti:someArray)System.out.print(i+"") 15.} What is the result?()A、123B、Compilation fails because of an error in line 12.C、Compilation fails because of an error in line 13.D、Compilation fails because of an error in line 14.E、A ClassCastException is thrown at runtime.

55. int []x= {1, 2,3,4, 5};  56. int y[] =x;  57. System.out.println(y[2]);  Which is true?() A、 Line 57 will print the value 2.B、 Line 57 will print the value 3.C、 Compilation will fail because of an error in line 55.D、 Compilation will fail because of an error in line 56.

12. String csv = “Sue,5,true,3”;  13. Scanner scanner = new Scanner( csv);  14. scanner.useDelimiter(”,”);  15. int age = scanner.nextInt();  What is the result?() A、 Compilation fails.B、 After line 15, the value of age is 5.C、 After line 15, the value of age is 3.D、 An exception is thrown at runtime.

1. public class A {  2.  3. private int counter = 0;  4.  5. public static int getInstanceCount() {  6. return counter;  7. }  8.  9. public A() {  10. counter++;  11. }  12.  13. }  Given this code from Class B:  25.A a1 =new A();  26. A a2 =new A();  27. A a3 =new A();  28. System.out.printIn(A.getInstanceCount() ); What is the result?() A、 Compilation of class A fails.B、 Line 28 prints the value 3 to System.out.C、 Line 28 prints the value 1 to System.out.D、 A runtime error occurs when line 25 executes.E、 Compilation fails because of an error on line 28.

Given: 12.String csv = "Sue,5,true,3"; 13.Scanner scanner = new Scanner( csv ); 14.scanner.useDelimiter(",");15. int age = scanner.nextInt(); What is the result?()A、Compilation fails.B、After line 15, the value of age is 5.C、After line 15, the value of age is 3.D、An exception is thrown at runtime.

单选题Given: What is the result?()A Compilation fails due to an error in line 23.B Compilation fails due to an error in line 29.C A ClassCastException occurs in line 29.D A ClassCastException occurs in line 31.E The value of all four objects prints in natural order.

单选题11. public static void main(String[] args) {  12. Object obj =new int[] { 1,2,3 };  13. int[] someArray = (int[])obj;  14. for (int i: someArray) System.out.print(i +“ “)  15. }  What is the result? ()A 1 2 3B Compilation fails because of an error in line 12.C Compilation fails because of an error in line 13.D Compilation fails because of an error in line 14.E A ClassCastException is thrown at runtime.

单选题Click the Exhibit button. Given this code from Class B: 25.A a1 = new A(); 26.A a2 = new A(); 27.A a3 = new A(); 28.System.out.println(A.getInstanceCount()); What is the result?()A Compilation of class A fails.B Line 28 prints the value 3 to System.out.C Line 28 prints the value 1 to System.out.D A runtime error occurs when line 25 executes.E Compilation fails because of an error on line 28.

单选题Click the Exhibit button.   Given this code from Class B:   25. A a1 = new A();   26. A a2 = new A();   27. A a3 = new A();   28. System.out.println(A.getInstanceCount());   What is the result?()A  Compilation of class A fails.B  Line 28 prints the value 3 to System.out.C  Line 28 prints the value 1 to System.out.D  Compilation fails because of an error on line 28.E  A runtime error occurs when line 25 executes.

单选题Given:   What is the result?()A  If you define D e = new E(), then e.bMethod() invokes the version of bMethod() defined in Line 5.B  If you define D e = (D)(new E()), then e.bMethod() invokes the version of bMethod() defined in Line 5.C  Compilation fails because of an error in line 9.D  If you define D e = (D)(new E()), then e.bMethod() invokes the version of bMethod() defined in Line 9.E  Compilation fails because of an error in line 3.F  Compilation fails because of an error in line 7.

单选题public class test (    public static void main (String args) {    int i = 0xFFFFFFF1;  int j = ~i;   }    )   What is the decimal value of j at line 5?()A 0B 1C 14D –15E An error at line 3 causes compilation to fail.F An error at line 4 causes compilation to fail.

单选题Click the Exhibit button. What is the result?()A Compilation of class A fails.B Line 28 prints the value 3 to System.out.C Line 28 prints the value 1 to System.out.D A runtime error occurs when line 25 executes.E Compilation fails because of an error on line 28.

单选题Given: 12.String csv = "Sue,5,true,3"; 13.Scanner scanner = new Scanner( csv ); 14.scanner.useDelimiter(",");15. int age = scanner.nextInt(); What is the result?()ACompilation fails.BAfter line 15, the value of age is 5.CAfter line 15, the value of age is 3.DAn exception is thrown at runtime.

单选题12. String csv = “Sue,5,true,3”;  13. Scanner scanner = new Scanner( csv);  14. scanner.useDelimiter(”,”);  15. int age = scanner.nextInt();  What is the result?()A Compilation fails.B After line 15, the value of age is 5.C After line 15, the value of age is 3.D An exception is thrown at runtime.

单选题Given:   11. public static void main(String[] args) {   12. Object obj = new int[] { 1, 2, 3 };   13. int[] someArray = (int[])obj;   14. for (int i : someArray) System.out.print(i + " ");   15. }   What is the result? ()A Compilation fails because of an error in line 13.B A ClassCastException is thrown at runtime.C 1 2 3D Compilation fails because of an error in line 14.E Compilation fails because of an error in line 12.

单选题What is the result?()A Compilation of class A fails.B Line 28 prints the value 3 to System.out.C Line 28 prints the value 1 to System.out.D A runtime error occurs when line 25 executes.E Compilation fails because of an error on line 28.

单选题Given: What is the result?()A Compilation fails.B exception is thrown at runtime.C The attribute id in the ItemTest object remains unchanged.D The attribute id in the ItemTest object is modified to the new value.E A new ItemTest object is created with the preferred value in the id attribute.

单选题1. public class Boxer1 {  2. Integer i;  3. int x;  4. public Boxer1(int y) {  5. x=i+y;  6. System.out.println(x);  7. }  8. public static void main(String[] args) {  9. new Boxer1(new Integer(4));  10. }  11. }  What is the result?()A The value “4” is printed at the command line.B Compilation fails because of an error in line 5.C Compilation fails because of an error in line 9.D A NullPointerException occurs at runtime.E A NumberFormatException occurs at runtime.F An IllegalStateException occurs at runtime.

单选题55. int []x= {1, 2,3,4, 5};  56. int y[] =x;  57. System.out.println(y[2]);  Which is true?()A Line 57 will print the value 2.B Line 57 will print the value 3.C Compilation will fail because of an error in line 55.D Compilation will fail because of an error in line 56.

单选题class Super {  public int getLenght( ) { return 4; }  }  public class Sub extends Super {  public long getLenght( ) { return 5; }  public static void main(String[] args) {  Super sooper = new Super( );  Sub sub = new Sub( );  System.out.println(  sooper.getLenght( ) + “,” + sub.getLenght( ) );  }  } What is the output?()A Just after line 13.B Just after line 14.C Just after line 15.D Just after line 16 (that is, as the method returns).

单选题1. public class A {  2.  3. private int counter = 0;  4.  5. public static int getInstanceCount() {  6. return counter;  7. }  8.  9. public A() {  10. counter++;  11. }  12.  13. }  Given this code from Class B:  25.A a1 =new A();  26. A a2 =new A();  27. A a3 =new A();  28. System.out.printIn(A.getInstanceCount() ); What is the result?()A Compilation of class A fails.B Line 28 prints the value 3 to System.out.C Line 28 prints the value 1 to System.out.D A runtime error occurs when line 25 executes.E Compilation fails because of an error on line 28.