Java collections and errors quiz

  • Admin
  • 1 min read

Nine questions on ArrayList, HashMap, exceptions, generics and file reading.

Java

Java collections and errors quiz

9 questions, instant feedback

Question 1 of 9 What is the difference between an array and an ArrayList?
Question 2 of 9 Which method adds to an ArrayList?
Question 3 of 9 What does a HashMap store?
Question 4 of 9 What does map.get(key) return for a missing key?
Question 5 of 9 Which exception must be caught or declared?
Question 6 of 9 What is the purpose of finally?
Question 7 of 9 What does a generic type parameter such as List give you?
Question 8 of 9 Which class reads a text file line by line?
Question 9 of 9 What is the modern way to ensure a file is closed?

Your answers stay in this browser. Nothing is sent to a server.