Month: June 2021

Queue in Java

table of contents What is Queue interface and what are the characteristics of Queue in JAVA? How to add element to a Queue? How do we remove element from a Queue? How do we find head element of a queue? How to iterate all elements of a Queue? What is Queue interface and what are […]

Map Interface in Java

table of contents What is Map interface in JAVA? How to add elements to a Map? How to remove element from Map? How can we modify an element in a Map? How do we iterate over map? What is LinkedHashMap? What is TreeMap and when should it be used? How to fetch all the keys […]

Set Interface in Java

table of contents What is Set interface? Describe different operations possible on a Set? How can we have an Ordered Set? How can we sort a Set? How to convert a Set to a List and vice versa? What is Set interface? The set interface present in java.util package extends Collection interface. It is an […]

List Interface in Java

Table of Contents What is List interface? Which classes implement List interface directly and indirectly? Demonstrate the features of List using a program. What are the different ways to iterate over a List? What are the differences between Iterator & ListIterator? What is LinkedList and what are the differences between LinkedList & ArrayList? What is […]

Interview Questions on Java Collections

table of contents Write a Program to check if an element is part of a collection or not. Write a program to reverse an ArrayList. Write a program to convert ArrayList to LinkedList and vice versa. How to get the highest and lowest values of a List? How to make a collection read-only? What is […]

Collection Framework in Java

Table of Contents What is Collection Framework in JAVA? What is the difference between Collection, Collection Framework & Collections in JAVA? Explain the collection framework hierarchy.  How do we declare a collection? What are the methods in Collection interface that are useful for any collection in JAVA? How to iterate over a collection? Iterate using […]

Exceptions in Java

Table of Contents What are exceptions in JAVA? What is the difference between checked and unchecked exceptions in JAVA? Types of exceptions in JAVA What is Throwable class in JAVA? Briefly describe all the keywords in JAVA exception handling.  How does try-catch work together? Can we have multiple catch statements for a single try block? Is it […]

OOPs in Java: Polymorphism, Access Modifiers, super & this keywords

Table Of Contents 0.1 Polymorphism 0.1.1 What is polymorphism in JAVA? How is that achieved? 0.1.2 What is method overloading? Explain with examples. 0.1.3 Why is method overloading also called compile time polymorphism? 0.1.4 What is method overriding? Explain with examples. 0.1.5 What is Dynamic Method Invocation in JAVA? Or, Why method overriding is known as runtime […]

OOPs in Java : Classes & Objects, Constructor, Inheritance, Encapsulation, Abstraction

Table Of Contents 0.1 Class, Object & Object Orientation 0.1.1 What is a constructor and why do we need them? 0.1.2 Can we overload constructors? 0.1.3 Can there be a private constructor? 0.2 Inheritance 0.2.1 What is Inheritance? Explain with an example.  0.2.2 Some specific points to remember with respect to Inheritance.        […]

Java Fundamentals

Table of Contents Explain public static void main (String [] args) which is commonly used in a JAVA program? Can we execute some code before main () method starts execution? What is Autoboxing and Unboxing in JAVA? What is postfix and prefix operator in JAVA? Find if a given number is prime or not Find […]