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

31. Which class implements the List interface?

  • HashMap
  • ArrayList
  • HashSet
  • TreeSet
Show Answer Report

32. Which keyword is used to refer to the current object?

  • self
  • me
  • this
  • object
Show Answer Report

33. Which of the following is not a feature of OOP?

  • Encapsulation
  • Abstraction
  • Compilation
  • Polymorphism
Show Answer Report

34. Which method returns the size of a collection?

  • count()
  • total()
  • size()
  • number()
Show Answer Report

35. Which collection allows null keys?

  • Hashtable
  • HashMap
  • TreeMap
  • TreeSet
Show Answer Report

36. What is the default value of object reference variables?

  • 0
  • empty
  • null
  • undefined
Show Answer Report

37. Which class is best for constant-time search operations?

  • LinkedList
  • HashMap
  • TreeMap
  • ArrayList
Show Answer Report

38. What is the parent interface of all collections?

  • Iterable
  • Collection
  • List
  • Object
Show Answer Report
Questions and Answers for Competitive Exams Various Entrance Test