Tuesday, August 17, 2010

Scanners

Courtesy of Sun Web Learning Center


Which three are true about the java.util.Scanner class compared to the String class's split() method? (Choose three.)

A Both are used primarily to tokenize source data.
B Only the Scanner class can use a custom delimiter.
C Only the Scanner class can use a stream as a source.
D The Scanner class allows you to exit before the entire source has been read.
E The split() method allows you to exit before the entire source has been read.

A, C, and D are correct. The split() method tokenizes the entire source in a single atomic operation.

No comments:

Post a Comment