HashMap in Java – How it Works?

Learn-Java-Featured-Image

Hashmap in Java is a class that implements Java map interface and found inside java.util package. It stores data based on key and value. It stores elements in an unsorted manner, which means it does not return elements in the order they’re inserted. Hashmap is denoted by “Hashmap<Key, Value>” Points to remember: Data is inserted …

Read more

Map Interface In Java

Learn-Java-Featured-Image

Java Map stores elements in the form of Key-Value pair where it maps keys to values. A map cannot contain duplicate keys and each key can map to at most one value where each pair of key-value is known as an Entry. If you want to perform operations based on key-value pair then Java Map …

Read more

LinkedList in Java

Learn-Java-Featured-Image

LinkedList in Java is a doubly-linked list implementation of the List and Deque interfaces and it is a part of the Collection framework. Java LinkedList is a class that extends AbstractSequentialList and implements List and Deque interface. Let’ see the implementation in Java: Java LinkedList can also be used as List, Queue, or Deque because …

Read more

ArrayList in Java

Learn-Java-Featured-Image

ArrayList in Java is a dynamic, resizable list of objects and utilizes an array data structure. Java ArrayList is a part of the Collection framework and it implements List Interface. Internally Java ArrayList uses an Array object to store elements dynamically or we can say Java ArrayList is backed with an array data structure inside …

Read more

Java List – List in Java

Learn-Java-Featured-Image

As you know Arrays are inflexible and fixed-size data structure whereas List in Java is flexible, dynamic, and ordered collection. Java List is a part of the collection framework where you can access List elements using some default methods. It gives you the functionality to access elements by their index, add, remove, and search elements. …

Read more

30+ Core Java Interview Questions For Freshers

Learn-Java-Featured-Image

Basics Question 1: What is Java and Its Benefits Java is one of the most popular and versatile programming language in the industry. Due to its nature of robustness, performance and platform-independent feature. Java can be used for the development of mobile applications, system development and many other platforms. Question 2: What is the difference …

Read more

If-Else Statement in Java

Learn-Java-Featured-Image

In Java, to check any certain condition whether it is true or false we use If-Else Statement in Java. If-Else Statement in Java checks boolean condition i.e True or False. There are mainly three types of statements: if statement if-else statement if-else-if nested if statement 1. Java if Statement: Let’s suppose I have to check …

Read more

Switch Statement in Java

Learn-Java-Featured-Image

I hope you have learnt Java if-else statement. In this chapter, we’ll learn the switch statement in java. Java switch statement can be an extension to the long if-else ladder. It makes your codes more clean and readable. Based on a single expression switch statement can execute multiple blocks of code. 1. Switch Statement in …

Read more

For Loop Statement in Java

Learn-Java-Featured-Image

In Java, looping statements are used to execute instructions repeatedly when your program meets a certain condition or evaluates to true. In this tutorial, we will be looking at the for-loop statement. Java provides many different ways to loop your statements. 1. For Loop Statement Syntax: initialization – variable initialization takes place. condition – It …

Read more

While Loop Statement in Java

Learn-Java-Featured-Image

In this tutorial, we are going to learn how to use while loop in Java. I hope you have read Java For-Loop Statement. In Java, looping statements are used to execute instructions repeatedly when your program meets a certain condition or evaluates to true. 1. Java While Loop Statement: Java While Loop is used to …

Read more