🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Observer, Strategy and Decorator: all 10 questions

Quiz: Observer, Strategy and Decorator · Question 8 of 10

Which JDK class is a well-known Decorator?

Which JDK class is a well-known Decorator?

  1. A.java.lang.Math
  2. B.BufferedReader, which wraps another Reader
  3. C.ArrayList
  4. D.String
Answer & explanation

Correct answer: BufferedReader, which wraps another Reader

new BufferedReader(new InputStreamReader(System.in)) adds buffering by wrapping.

Can you get the rest right without peeking?

Take the timed Quiz: Observer, Strategy and Decorator quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →