How HashMap Works THumbnail

The Magic Behind HashMap and How it works in Java

Hey! tea lovers! In this post, we will be discussing how HashMap, the key-value-based data structure, works in Java. And it is one of the most asked interview questions as well. It is the core feature we as a developer use daily. Primarily used for easy and faster access to data based on the key. So let us see how it stores, retrieves and updates the data. I will put more articles under the Simply Explained tag. For now, let us get started with HashMap. So make your cup of tea to sip and code. ...

March 20, 2022 路 6 min 路 Imran Shaikh
7 Best Ways You can Loop through Lists in Java

7 Best Ways You can Loop through Lists in Java

Hey, Tea Lovers! Let鈥檚 look at the 7 ways you can iterate or loop through a Java List. These are ordered from basic to advance to pro level. So let鈥檚 jump to see different types of loops in java I will use the same list throughout all the code samples. List<Integer> list = Arrays.asList(1, 2, 3, 4, 5, 6, 6, 7, 8, 10); Basic Level of Loops First, let鈥檚 look at the basic level of looping. These are your for-loop, while-loop, and enhanced for-loop. Let鈥檚 take a look at them one by one. ...

August 10, 2021 路 5 min 路 Imran Shaikh
Most Loved Interview Question _ Comparator vs Comparable

Interview Question: Comparable vs Comparator

Hey, Tea Lovers! Today let鈥檚 look at the most asked interview question, Comparable vs Comparator. Both beginners and experienced people get this question in their interviews. This post is one of the many in the series of Interview Questions, where we don鈥檛 just hang you with one line answer, but rather try to explain it so that it gets fits into your head. I know you are in a hurry to prepare for the interview, so I will make this post as short as possible, So prepare your cup of tea to sip and code. ...

November 14, 2020 路 11 min 路 Mahesh More
Stream API The Hero Without a Cape

Stream API: The Hero Without a Cape

Hey Tea Lovers! In this post, we will be talking about an unsung hero of the Java world, the Stream API which was added to Java 8 and has changed the way we do programs in java and how! It added neatness as well as made the program more readable. It helps you do functional programming in Java. Without any further ado, let us read more about this jewel. What is Stream API The Stream API, included in Java 8, is utilized for processing聽collections of objects. It is the flow of Objets on which various methods get applied in the pipeline to have the result. Simply put, it flows through the given聽Collection<Object>聽and applies the different methods on the聽Object聽to aggregate them into the desired result without affecting the original聽Object. ...

May 11, 2020 路 9 min 路 Imran Shaikh