Java EE 7 Application Developer — Question 38
Which class do you use to handle an incoming JSON Message as a stream?
Answer options
- A. JsonReader
- B. JsonObjectBuilder
- C. JsonParser
- D. JsonObject
Correct answer: A
Explanation
The correct answer is JsonReader, as it is specifically designed to read JSON data in a streaming fashion. JsonObjectBuilder is used for constructing JSON objects, JsonParser is for parsing JSON into a tree structure, and JsonObject represents a JSON object in memory, making them unsuitable for handling incoming JSON messages as streams.