Java 21 : Record Patterns, Pattern Matching and Virtual Threads

Java 21 release brings along with it new features which are very much programmer friendly and helps developer to reduce the amount of code to achieve same functionality. In this article, we will go through three of these features – Record Patterns, Pattern Matching for switch and Virtual Threads. Record Patterns This feature helps in […]

Java 21 : Record Patterns, Pattern Matching and Virtual Threads Read More »

Java Reflection: Arrays

Reflection API provides us various methods to play around with array objects also. Refer below code demonstrating different array reflection methods. newInstance() method in Array.java class helps us to create an array using reflection.isArray() method on Class.java object represent whether the object is an array or not.getComponentType() method on Class.java helps to identify the type

Java Reflection: Arrays Read More »

Thread Lock classes

Since now we have some idea on locks and how threads use them for execution, Let’s look into some classes which further helps us in our use cases. ReentrantLock class: In addition to lock functionality, this class provide few more utility methods which help us in our user cases. tryLock() method: This method returns boolean

Thread Lock classes Read More »

Create Threads in Java

Multithreading can be viewed as a digital world’s term for multi-tasking. When someone say they are multitasking, they are performing multiple different tasks within a timeframe. Even though it is an advanced topic, its use can be observed in our day-to-day basic tasks – Multi-tasking in Java can be achieved using Threads and thus the

Create Threads in Java Read More »