Learn Java and Programming through articles, code examples, and tutorials for developers of all levels.
Saturday, October 28, 2023
Java 8 Stream.filter() example Example with Null and Empty String
Saturday, October 21, 2023
10 Example of Comparator and Sorting in Java 8
The Comparator class is used to provide code or logic for comparing objects in Java, while sorting a list of objects or a collection of objects. It's close cousin of Comparable which provides natural order sorting e.g. ascending and descending orders for numbers like int, short, long or float, and lexicographic order for String i.e. the order on which words are arranged in dictionaries. The Comparators are used while sorting arrays, lists and collections. You pass logic to compare objects and sorting methods like Collections.sort() use that logic to compare elements until they are arranged in sorted order.
Monday, October 16, 2023
Top 14 Courses to Learn System Design and Software Architecture in 2024 - Best of Lot
Tuesday, October 10, 2023
How to Create and Extract a ZIP File in Java? Unzip Example Tutorial
Monday, October 9, 2023
How to implement Level Order Traversal of Binary Tree in Java? Example Tutorial
Sunday, October 8, 2023
How to make Immutable class in Java? Mutable vs Immutable Objects
How I make immutable objects in Java? I've always thought that all objects are immutable, because if you change the content of an String example, it will always create you an new String object and point to that. However later I found that String is a special class and its specially designed as an Immutable class because its often cached. Obviously you cannot cache anything which is not constant and that make sense why String is Immutable in Java. But this encouraged me to learn more about Mutable and Immutable class in Java and how to create a custom Immutable class in Java.
Saturday, October 7, 2023
Why is Java Considered a Secure Programming Language?
Friday, October 6, 2023
Top 5 JavaScript Data Structure and Algorithm Courses for Beginners to Learn in 2024 - Best of Lot
Thursday, October 5, 2023
Top 7 Free Core Spring, Spring MVC, and Spring Boot Courses for Beginners in 2024 - Best of Lot
Sunday, October 1, 2023
Difference between Queue and Deque in Java? Example Tutorial
Hello guys, today I am going to share another interesting question from Java interview, what is difference between Queue and Deque in Java. This question was asked to one of my reader in a recent interview with JP Morgan Mumbai and this is also a popular Java collection interview question. While he was able to answer the question, he wasn't able to convince interviewer so he asked me how to answer this question. So I am writing this post to share my answer on Queue vs Deque in Java. In the vast world of Java programming, the need to manage data efficiently often leads developers to specialized data structures.