🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: File Handling in Java: all 10 questions

Quiz: File Handling in Java · Question 1 of 10

Which classes should you use to copy a JPG image file?

Which classes should you use to copy a JPG image file?

  1. A.FileReader and FileWriter
  2. B.FileInputStream and FileOutputStream (byte streams)
  3. C.Scanner and PrintWriter
  4. D.BufferedReader and BufferedWriter
Answer & explanation

Correct answer: FileInputStream and FileOutputStream (byte streams)

Images are binary data. Character streams would try to decode the bytes as text and can corrupt them.

Can you get the rest right without peeking?

Take the timed Quiz: File Handling in Java quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →