KSkartik sharmainsetter.hashnode.dev·May 17, 2025 · 2 min readMastering Custom Sorting in Java: Comparator Made SimpleIf you’ve ever needed to sort a list of objects in Java say, a list of students by marks, names, or roll numbers you’ve likely bumped into Comparator. It’s one of the most powerful (and often underrated) tools in the Java Collections framework. Wha...00
KSkartik sharmainsetter.hashnode.dev·Mar 7, 2025 · 2 min readMastering the Sieve of Eratosthenes: Finding Closest Primes EfficientlyIntroduction While doing LeetCode's daily challenge today, I faced a problem that needed me to find the nearest pair of primes within a specific range efficiently. While doing so, I got to know about the Sieve of Eratosthenes, which is a fast algor...00
KSkartik sharmainsetter.hashnode.dev·Mar 1, 2025 · 2 min readAn Introduction to Java Multithreading ConceptsWhat is Multithreading? Multithreading is a technique in which multiple tasks run simultaneously within the same program. It allows efficient utilization of CPU by executing multiple threads independently. Example Think of a web browser , You can ope...00
KSkartik sharmainsetter.hashnode.dev·Feb 21, 2025 · 1 min readLogging in JavaLogging is an essential part of software development that helps track important events, debug errors, and analyze application behavior. Instead of relying on System.out.println(), which is not efficient for large-scale applications, developers use lo...00
KSkartik sharmainsetter.hashnode.dev·Jul 4, 2024 · 2 min readDemonstration of passing object reference by value as parameter in java methods .ATTEMPTING TO REASSIGN OBJECT . If you reassign an object reference inside java method it do not affect the original state of object outside that method .Below is an demonstration ,that shows java passes object reference by value . public class n { ...00