Skip to content
CodeKruPro

List.of and Arrays.asList are not ordinary lists

QuizMediumJava onlyAsked in: Capgemini, Wipro

Which statements are true? Pick all that apply.

  • List.of(1, 2).add(3) throws UnsupportedOperationException
  • Arrays.asList(1, 2).set(0, 9) works
  • Arrays.asList(1, 2).add(3) works
  • List.of(1, null) creates a list holding a null

This question is part of Pro+

Pro+ opens every question in Interview Prep and the mock interview. Every article and the first 2 questions of each topic stay free. Hands-on Selenium and API tasks follow their course lesson's own lock.

See Pro+

Already have Pro+? Sign in