What's New

15 Feb 2021

Java 11: Running a Java File

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

Custom Annotation in Java

Create Custom Annotation In java, creating an annotation is @interface is used to create an Annotation. public @interface MyAnnotatio...
Constructor with return Statement

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

Binary Search in Java with Example

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

Linear Search in Java with Example

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

View Resolver in Spring MVC

Spring MVC Framework provides the flexibility to use a View Resolver which is responsible for  resolving the views with their shorter pa...
Spring MVC: @Controller Annotation Based Controller

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

Spring MVC Hello World Example with Web Project in Eclipse

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

Count Down Latch in Java

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

CyclicBarrier in Java

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

Object Level and Class Level Locks in Java

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

Threads - Reentrant Lock in Java with Example

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 and Unboxing in Java

Autoboxing is an automatic conversion of primitive type into its corresponding wrapper class object by the java compiler. For an example...
Difference Between HashSet, LinkedHashSet And TreeSet

HashSet, LinkedHashSet and TreeSet are the implementations of Set interface which does not allow duplicate elements. In this tutorial we wi...

12 Feb 2016

Replace Multiple Consecutive Characters with Single Charater in Java

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

Can We Call Start Method Twice on Same Thread?

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

How to Get the Last Element of an ArrayList

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

How to know the Java Compiler Version of a Generated Java Class file

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

Calling a Constructor Explicitly in Java

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

Usage of this Keyword in Java with Example

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...
Popular Posts

Write to Us
Name
Email
Message