|
|
350 Mock Questions on SCJP 1.5 - JUST Rs.200 or 7 USD
Send us mail to sales@javabeat.net
more details
|
Do you have paypal account? Click Here to pay now and get the questions.
|
|
SCJP 5.0 Misc. New API's (String Builder, Scanner, Formatter) Mock Exam Questions - 1 (10 Questions)
1) What will be the output of the following program?
package misc_apis;
import java.util.Scanner;
public class ScannerTest3 {
public static void main(String[] args) {
Scanner scanner = new Scanner("hello 1 2.00 false");
scanner.useDelimiter(" ");
String str = scanner.next();
int anInt = scanner.nextInt();
float aFloat = scanner.nextFloat();
boolean booleanValue = scanner.nextBoolean();
System.out.println(str + ":" + anInt + ":" + aFloat + ":" + booleanValue);
}
}
- The program will output 'hello:1:2.0:false'
- The program will throw Input Mismatch exception at the run-time
- The program will output nothing.
- The program will ouput ':1:2.0:false'
Answer
1) 1
The output will be 'hello:1:2.0:false'.
|
|
350 Mock Questions on SCJP 1.5 - JUST Rs.200 or 7 USD
Send us mail to sales@javabeat.net
more details
|
|