ThreadLocal Java Example

ThreadLocal is a class that provides thread local variable and is used to achieve thread safety. The data stored will be accessible only by a specific thread. ThreadLocal extends Object class and provides thread restriction which is a “part” from local variable. Creating a ThreadLocal variable ThreadLocal threadLocalExample = new ThreadLocal(); The instantiation of the…

Continue reading

Java Parallel Streams Example

Stream API allows developers to  take advatange of multi core architectures and improve the performance of Java program by  creating parallel streams and making your program perform operations faster. There are two ways of creating a parallel stream: by using the parallelStream() method by using the parallel() method When you are using parallel streams, effectively…

Continue reading

Depth-First-Search Example Java

Searching and/or traversing are equally important when it comes to accessing data from a given data structure in Java. Graphs and Trees are an example of data structures which can be searched and/or traversed using different methods. Depth-first-search, DFS in short, starts with an unvisited node and starts selecting an adjacent node until there is…

Continue reading

Breadth-First-Search Example Java

Searching or traversing is really important when it comes to accessing data from a given data structure. There are different methods of traversing/searching elements within these data structures such as Graphs and Trees. Breadth-first search is one example of these methods. BFS is an algorithm that traverses tree or graph and it starts from the…

Continue reading

Best Tips to Hire Java Developers for Building High-Performance Java Applications

According to history, Java was launched nearly 20 years earlier, with new ideas of object-oriented programming that improved the misunderstandings of other common languages at the time, for instance, C or C++. Java’s garbage amassing and its fundamental doubter virtual machine made another technique for programming and introduced the new idea of “Create once, run…

Continue reading