Java67
Learn Java and Programming through articles, code examples, and tutorials for developers of all levels.
Sunday, November 12, 2023
How to remove given character from String using Recursion and Iteration in Java? Coding Interview Question
Monday, November 6, 2023
Polymorphism and Open Closed Design Principle Example in Java
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.