Skip to content

Interview Sansar

Software jobs interview preparation source

  • Home
  • Interview Questions
    • C Interview Questions
    • C++ Advanced Interview Questions
    • C++ Basic Interview Questions
    • Core Java Interview Questions
    • Java Collections Interview Questions
    • Java Multithreading Interview Questions
    • C# Basic Interview Questions
    • C# Advanced Interview Questions
    • C# Multi-threading Interview Questions
  • MCQs
    • MCQ-C++
    • MCQ-Java
    • MCQ-SQL
    • MCQs Algorithms and Data Structure
  • Programming Examples
    • C Programming Examples
    • C++ Programming Examples
    • C# Programming Examples
    • SQL Examples
    • Oracle PL SQL Examples
    • Time Complexity
  • Blog
    • C++ interview questions
    • C# interview questions
    • Java Interview Questions
    • Short Interview Questions
    • Behavioural / HR Interview
  • You-Tube
  • About
    • Why Visit
    • Sitemap
    • Contact Us
    • e-author

Category: Java Collections Interview Questions

Java Collections interview questions and answers for freshers and experienced asked in technical interviews in IT companies for software job | Only Real

Java Collections Interview Questions

If we try to insert duplicate values in a “Set”, what will happen? Do we get any complier error?

August 18, 2024July 14, 2014 rsingh

Just it doesn’t add duplicate values. Boolean add(E e) – Adds the specified element to this set if it is not already present (optional operation). As, add() method returns Boolean and on adding duplicates

Read More
Java Collections Interview Questions

What is time complexity for offer, poll and peek methods in priority queue Java ?

August 18, 2024May 16, 2015 rsingh

Answer: Time complexity for the methods offer & poll is O(log(n)) and for the peek() it is Constant time O(1) of java priority queue. SIDE

Read More
Java Collections Interview Questions

ADT(Abstract Data Type) Vs Data Structure Interview question

August 18, 2024May 17, 2015 rsingh

Answer: ADT (Abstract Data type) represents a set of particular behaviors. for example, LIST represents a sequence of values, a QUEUE represents a FIFO(First in

Read More
Java Collections Interview Questions

Which to prefer add() or offer() to add items in Java Queue?

August 18, 2024January 29, 2023 rsingh

Both java queue add () and offer () methods are available in the Queue interface and are used to add elements to the queue. Preference

Read More
Java Collections Interview Questions

What is difference between Arraylist and Vector in java?

August 18, 2024May 22, 2015 rsingh

Difference between Arraylist and Vector in java in Java Collections. I’ll be listing 4 important differences between java arraylist and vector data structures. Java ArrayList

Read More
Java Collections Interview Questions

Write a program to sort employees by their experience. Employee class is not allowed to implement any interface.

August 18, 2024May 26, 2015 rsingh

Answer: For sorting employees we need to use either Comparable or comparator interface. Since, as per question, the Employee class is not allowed to implement

Read More
Java Collections Interview Questions

What is difference between Iterator and ListIterator?

August 18, 2024May 27, 2015 rsingh

Answer: Here is the differences and advantages of ListIterator over Iterator. 1-Iterator is available to all Collection classes whereas ListIterator is available to only List

Read More
Java Collections Interview Questions

What are advantages of comparator in Java over comparable?

August 18, 2024January 29, 2023 rsingh

Answer includes advantages of comparator over comparable interfaces in java and the differences between them. As a side note, what’re advantages  of comparator over comparable, and when would

Read More
Java Collections Interview Questions

Java Collections short interview FAQs with answers – Real

August 18, 2024June 20, 2015 rsingh

List of Java Collection short interview questions and answer asked in software job / technical interviews. This list is helpful for telephonic or face to

Read More
Java Collections Interview Questions

Explain vector, time complexity and how vector grows in java

August 18, 2024January 19, 2016 rsingh

Answer: Vector & time complexity in Java: Vector is a dynamic array that grows or shrinks on run time to accommodate items during addition or

Read More

Posts pagination

1 2 Next

My Unique Books for YOU

All Rights Reserved 2023: Interview Sansar.
Proudly powered by WordPress | Theme: Fairy Blog by Candid Themes.