Posts

Showing posts from March, 2023

Understanding and Avoiding Race Conditions in Java

Image
Race conditions can occur when multiple threads access shared mutable data at the same time, leading to unpredictable behavior and errors in the program. To avoid race conditions, it's important to synchronize access to shared resources using techniques such as locks, atomic operations, and thread-safe data structures.

Microsoft SQL Server vs. Oracle: Same, yet different?

Image

Java: ensureCapacity() method to increase the size of an ArrayList explicitly

Image
The default size of an ArrayList in Java is 10. When you create a new instance of ArrayList without specifying an initial capacity, it will create an internal array of size 10 to hold the elements you add to the list.