Home » Author Archives: Pankaj Kumar (page 3)

Author Archives: Pankaj Kumar

Java Deadlock Example – How to analyze deadlock situation

java-logo

Deadlock is a programming situation where two or more threads are blocked forever, this situation arises with at least two threads and two or more resources. Here I have written a simple program that will cause deadlock scenario and then we will see how to analyze it.               Java Deadlock Example package com.journaldev.threads; public ...

Read More »

Java Annotations Tutorial with Custom Annotation

java-logo

Java Annotations provide information about the code and they have no direct effect on the code they annotate. In this tutorial, we will learn about Java annotations, how to write custom annotation, annotations usage and how to parse annotations using reflection. Annotations are introduced in Java 1.5 and now it’s heavily used in Java frameworks like Hibernate, Jersey, Spring. Annotation ...

Read More »

Java Regular Expression Tutorial with Examples

java-interview-questions-answers

When I started my career in java, regular expressions were a nightmare for me. This tutorial is aimed to help you mastering java regular expression and for me to come back at regular interval to refresh my regular expressions learning. What Are Regular Expressions? A regular expression defines a pattern for a String. Regular Expressions can be used to search, ...

Read More »

Rest using Jersey – Complete Tutorial with JAXB, Exception Handling and Client Program

java-interview-questions-answers

Recently I started working on a Restful web service project using Jersey API. There are some tutorials available online but I faced some issues with exception handling and I didn’t found anywhere complete project using JaxB and providing exception handling approach. So once I was able to create a Restful web service using Jersey API with exception handling and client ...

Read More »

Generate QR Code image from Java Program

ZXing-logo

If you are tech and gadget savvy, then you must be aware of QR codes. You will find it everywhere these days – in blogs, websites and even in some public places. This is very popular in mobile apps, where you scan the QR code using a QR Code scanner app and it will show you the text or redirect ...

Read More »

How to Avoid ConcurrentModificationException when using an Iterator

java-logo

Java Collection classes are fail-fast which means that if the Collection will be changed while some thread is traversing over it using iterator, the iterator.next() will throw a ConcurrentModificationException. This situation can come in case of multithreaded as well as single threaded environment. Lets explore this scenario with the following example: import java.util.*; public class IteratorExample { public static void ...

Read More »

Understanding and Extending Java ClassLoader

java-logo

The Java ClassLoader is one of the crucial but rarely used components of Java in Project Development. Personally I have never extended ClassLoader in any of my projects but the idea of having my own ClassLoader that can customize the Java Class Loading thrills me. This article will provide an overview of Java Class Loading and then move forward to ...

Read More »
Want to take your Java Skills to the next level?
Grab our programming books for FREE!
  • Save time by leveraging our field-tested solutions to common problems.
  • The books cover a wide range of topics, from JPA and JUnit, to JMeter and Android.
  • Each book comes as a standalone guide (with source code provided), so that you use it as reference.
Last Step ...

Where should we send the free eBooks?

Good Work!
To download the books, please verify your email address by following the instructions found on the email we just sent you.