Browsed by
Tag: collection framework

Collection Framework Interview Questions – Set 1

Collection Framework Interview Questions – Set 1

Hello Folks, collection is the favorite and popular among interviewers. Here is the list of most frequently asked collection interview questions and their answers.

Click here if you want to learn more about collection framework and their praticle implementations.

1). What is a collection framework ?

A collection framework is a class library to handle group of objects. Collection framework is implemented in java.util.package which gives you lists, sets, maps and queue to satisfy most of your coding needs.

Read More Read More

TreeMap in Java

TreeMap in Java

The TreeMap class implements the Map interface which store key-value pairs in tree data structure. It provides an efficient means of storing key/values pairs in sorted order.

Followings are the features of TreeMap.

  1. It contains only unique elements.
  2. It can’t have null key but can have multiple null values.
  3. It is not synchronized i.e not safe for multi-threaded application.
  4. It is same as HashMap instead maintains ascending order.

Read More Read More

Stack in Java

Stack in Java

Stack class represents a last-in-first-out(LIFO) stack of objects. It extends class Vector with five operations that allow a vector to be treated as a stack. When a stack is first created, it contains no items. Creation of Stack using Array and Linked List has been explained here.

In addition to method provided by its base class Vector, Stack provides following methods.

Read More Read More