Brick Game in Java

If you’re a fan of classic arcade games, you’ve probably played Brick Game before. It’s a simple game that involves maneuvering a paddle to hit a ball that bounces around, trying to break through a wall of bricks. In this article, we’ll show you how to create your own Brick Game in Java with Source … Continue reading “Brick Game in Java”

File Handling In Java

File handling is a critical aspect of any programming language. File handling refers to manipulating files and directories on the file system. This article will provide an overview of file handling in Java. java.io.File Class The File class in Java is the primary way to handle files and directories. It is part of the java.io … Continue reading “File Handling In Java”

Bubble Sort – Java

Sorting is one of the major required feature for any application during implementation of any business logic. There are different types of sorting in place based on performance, speed, cost of operation. One of simplest and easy algorithm is Bubble Sort Algorithm which is an easy one to understand/implement for any quick implementation. Sorting a … Continue reading “Bubble Sort – Java”

Configure Log4j2 Converter Plugin -Java (Filter log messages)

Apache Log4j2 is used for printing info, error, debug, trace logging statements in enterprise applications. Inorder to format all the log messages externally before printing in logs, we need to create Filters in Log4j 1.x versions. In Log4j2 , we can use LogEventPatternConverter to filter/convert/format log messages before printing in the log files in server. … Continue reading “Configure Log4j2 Converter Plugin -Java (Filter log messages)”

Configure Log4j2 -Java in minutes

Apache Log4j2 is used for printing info, error, debug, trace logging statements in enterprise applications. Apache Log4j2.x is an extension of Log4j1.x which has more significant features comparatively.Since major security vulnerabilities like Log4jShell & hacking possibilities are identified in Log4j1.x, it is always recommended to use Log4j2.x. It is pretty simple to configure Log4j2 in … Continue reading “Configure Log4j2 -Java in minutes”

SimpleDateFormat (Parse Date)

Date conversions are very common scenarios in any application., Java Provides SimpleDateFormat class for String to Date, Date to String conversions. The below example shows How String format can be converted to Date Format. How to find difference between 2 Dates. Code:

Output

BlockingDeque

BlockingDeque is an extended implementation of queue where we can enqueue or dequeue on both ends of the queue. All BlockingDeque implementions on array or linked queues are thread-safe implementations. Below is a simple usage of BlockingDeque

Output: