Ant Build Tool : Quick Notes

Ant Build Tool : Quick Notes

Ant Script for JAVA Developers 1) Simple Ant Script for Clean , Compile and jar generation adding Manifest information to jar

Note :- All folder path are relative to basedir . Here is basedir=”.” Note :- the values at class-path are separated by space 2) Using Property in Ant Script

3) Reading From Property File

4) Current Time Stamp in Ant Script

5) Directory Opertaions Make dir

6) Ant Script and Svn SVN Checkout

Note…

Read More Read More

Blank final field in Java

Blank final field in Java

A variable that is declared as final and not initialized is called a blank final variable. A blank final variable forces the constructors to initialize it. In other words The final property of class must have a value assigned before object is created. So the last point where you can assign value to them is constructor. This is used often for immutable objects.

Fail Fast vs Fail Safe Iterator in Java

Fail Fast vs Fail Safe Iterator in Java

When an iterator is created, either it is directly created on the collection (Fail Fast), or created on a clone of that collection (Fail Safe).This brings below two types of Iterator. Fail Fast : As name suggest fail-fast Iterators fail as soon as they realized that structure of Collection has been modified since iteration has begun, if the iterator thread realizes the modification ,then it throws ConcurrentModificationException. Changes can be additions, updation or deletion. This behavior (fail-fast) is implemented by…

Read More Read More

Double Brace Initialization In Java

Double Brace Initialization In Java

Another way of initializing collections and objects in Java. This is rarely known concept of Java,although this type of initialization has been with java from many years. The technique/concept is called Double Brace Initialization technique in Java. Lets start with an example. Using ArrayList in java (Normal way)

Double Brace Initialization of the same code:

Lets understand how it works The first brace creates a new AnonymousInnerClass, the second declares an instance initializer block, which is executed when the anonymous…

Read More Read More