Objects and Collections Questions and Answers

Take Exam

Java Objects and Collections programming questions and answers are essential for mastering object-oriented design and data structure handling. These questions often appear in coding interviews by Infosys, TCS, and Accenture. The topic covers object creation, reference handling, garbage collection, and the use of Java Collection Framework classes like List, Set, and Map. Understanding how to manage and iterate over collections efficiently helps in building optimized programs. Practicing programming questions and answers in this area enhances both logic and coding speed—crucial skills for clearing technical interview rounds and online assessments.

Objects and Collections

Showing 10 of 38 questions

21. Which wrapper class represents integer values?

  • Float
  • Integer
  • Double
  • String
Show Answer Report

22. Which collection class maintains insertion order?

  • HashSet
  • TreeSet
  • LinkedHashSet
  • PriorityQueue
Show Answer Report

23. Which method adds an element to an ArrayList?

  • insert()
  • put()
  • add()
  • push()
Show Answer Report

24. Which reference indicates an object is not pointing anywhere?

  • void
  • delete
  • null
  • none
Show Answer Report

25. Which of these is not a Java collection interface?

  • List
  • Set
  • Map
  • Structure
Show Answer Report

26. Which class stores elements in sorted order?

  • TreeSet
  • HashSet
  • ArrayList
  • Vector
Show Answer Report

27. Which method removes all elements from a collection?

  • clear()
  • delete()
  • removeAll()
  • empty()
Show Answer Report

28. Which concept allows objects to take many forms?

  • Abstraction
  • Encapsulation
  • Polymorphism
  • Inheritance
Show Answer Report

29. Which operator is used to access object members?

  • ::
  • ->
  • .
  • :
Show Answer Report

30. Which collection allows FIFO (First-In, First-Out) order?

  • List
  • Queue
  • Set
  • Map
Show Answer Report
Questions and Answers for Competitive Exams Various Entrance Test