CONCURRENCY / NOTES</>↗Concurrency04 May 2025
When working with concurrent collections in Java, thread safety issues can be minimized or completely avoided by using the right tools and patterns provided by the Java concurrency library. Here are some guidelines for avoiding thread safety issues using concurrent collections: 1. Use Concurrent Collections Java provides a range of thread-safe collections in the java.util.concurrent […]
SPRING CORE / NOTES</>↗Spring Core04 May 2025
Creating your first Spring bean using XML configuration is a straightforward process. Here’s a step-by-step guide: 1. Add Spring Framework to Your Project Make sure you have Spring dependencies added to your project. If you’re using Maven, include the following dependencies in your pom.xml: <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>6.2.6</version> <!– Update to a stable version –> […]
JAVA 10 / NOTES</>↗Java 1004 May 2025
Java 10 introduced the List.copyOf(), Set.copyOf(), and Map.copyOf() methods as convenient ways to create unmodifiable copies of existing collections. These methods are part of the java.util package and provide a simpler way to create immutable collections compared to using older methods like Collections.unmodifiableList(). Here’s how you can use them: 1. List.copyOf() The List.copyOf() method creates […]
CONCURRENCY / NOTES</>↗Concurrency04 May 2025
In Java, the CountDownLatch is a synchronization aid that allows one or more threads to wait until a set of operations being performed in other threads is complete. It is part of the java.util.concurrent package. How It Works A CountDownLatch is initialized with a given count. Each time one of the threads completes its task, […]
TOOLS / NOTES</>↗Tools03 May 2025
SDKMAN (Software Development Kit Manager) is a command-line tool that allows you to manage multiple versions of Java and other SDKs easily. Here’s how you can install and manage multiple Java versions using SDKMAN: Step 1: Install SDKMAN Open your terminal. Run the following command to install SDKMAN: curl -s "https://get.sdkman.io" | bash Follow the […]
JSCH / NOTES</>↗JSch03 May 2025
To execute multiple commands sequentially using JSch’s ChannelShell, you need to establish a persistent shell session and then pass the commands in sequence. The ChannelShell uses an input and output stream to communicate with the remote host. Here is a step-by-step approach and a sample implementation: Steps to Execute Commands Sequentially Initialize the JSch session: […]