Java Streams   «Prev  Next»

Writing Java Streams - Quiz

Each question is worth one point. Select the best answer or answers for each question.
 
1. What data type does the write() method return?
Please select the best answer.
  A. byte
  B. int
  C. long
  D. void


2. When should you explicitly flush an output stream?
Please select the best answer.
  A. Whenever you need to make sure data is sent before you're through with the stream
  B. Never, because all output streams automatically flush whenever a new line in written
  C. Always
  D. Whenever you've used the output stream for a very short time


3. The maximum number of bytes that can be written with one method call is:
Please select the best answer.
  A. 32,767
  B. 2,147,483,647
  C. 2,147,483,648
  D. 4,294,967,294


4. What does the following line of code print?
System.out.write(65 + 256);

Please select the best answer.
  A. 65
  B. 321
  C. 65256
  D. A


Your score is 0.0