15 Feb 2021
Java 11 changed the way to run a java file that we don't need to compile the Java source files with javac explicitly anymore. Before Ja...
8 Jun 2018
Create Custom Annotation In java, creating an annotation is @interface is used to create an Annotation. public @interface MyAnnotatio...
Generally, a constructor cannot have any return type and it cannot return any value. So, it is invalid to have a return statement which re...
6 Jun 2018
It is an algorithm that searches for an element in a sorted array and it follows Divide and Conquer algorithmic model. Dictionary is the ...
5 Jun 2018
It is an algorithm that searches for an element one by one in an array, until the target element is found. Consider if X is an element to...
8 May 2018
Spring MVC Framework provides the flexibility to use a View Resolver which is responsible for resolving the views with their shorter pa...
Spring MVC Framework provides @Controller annotation type used to annotate a Java class which acts as a Controller. Here’s is an exampl...
7 May 2018
In this tutorial we will see how to create a Spring MVC Web Application by using Maven in Eclipse. 1. Create a new Dynamic Web Project ...
4 Feb 2018
What is a Count Down Latch? A Count Down Latch is a java Synchronizer which allows one or more threads to wait until a set of opera...
14 Dec 2017
What is a CyclicBarrier? A Cyclic Barrier is another java Synchronizer which allows a set of threads to wait for each other to reach ...
8 Dec 2017
In Java, Synchronization provides a synchronized modifier which is used for method and block only. With the help of it, we can restrict ...
3 Dec 2017
Reentrant Lock Lock API was introduced in JDK 1.5 in java.util.concurrent.locks Concurrency package. Reentrant Lock provides more flex...
26 Feb 2016
Autoboxing is an automatic conversion of primitive type into its corresponding wrapper class object by the java compiler. For an example...
HashSet, LinkedHashSet and TreeSet are the implementations of Set interface which does not allow duplicate elements. In this tutorial we wi...
12 Feb 2016
This tutorial shows you how to replace multiple consecutive characters with single character. Consider we have an input as: String str = &q...
28 Dec 2015
It is never possible & illegal to invoke start method on same instance of thread object in java. If we try to do so then java.lang.Ill...
3 Nov 2015
By default ArrayList doesn't have any such method to read its last element directly. So, if we require to read the last element of an A...
7 Oct 2015
Without knowing the exact java compiler version of a generated class file it is difficult to overcome with compatibility issues. This tuto...
12 Jun 2015
Inside a constructor we can call another constructor explicitly by using super or this keyword, where this is to call another constructor ...
11 Jun 2015
In java this is a reference to the current object whose method or constructor is being called. So, by using this you can access any membe...