Category Archives: Java

Contains all JAVA and related Frameworks posts.

New Features in Java 9

Java Programming Language is one of the most popular programming languages which is widely used in enterprise software development. The newest version of the Java SDK is Java 9 and is expected to be released in early 2016 under the name of Java Development Kit 9. This version would include enhancements in application performance, new… Read More »

Marker Interface in Java

One of the “clean” features of the Java programming language is that it mandates a separation between interfaces(pure behavior) and classes (state and behavior). Interfaces are used in Java to specify the behavior of derived classes. Marker interface in Java is the interface with no fields or methods or in simple word an empty interface. Marker Interfaces are… Read More »

Log4j Configuration in Java project

Apache log4j is logging library for Java which is distributed under the Apache Software License. In this post we will learn log4j configuration in a sample java project using eclipse IDE. You can download the latest version of log4j.jar from here. If the link does not work copy and paste the below URL in the browser… Read More »

Java : Load Properties files

In this post we will know how to load properties files in java. Properties files are amazing resources to add information. In General these files are used to store static information. We add the information in key and value pair. The values which we do not want to hard code in our Java code can… Read More »

Restful web services implementation using Jersey

In the previous post we discussed about the Restful web services annotations and HTTP methods. In this post we learn development of Restful web services using Jersey Framework in the Eclipse IDE in Java. We will develop a sample HelloWorld rest service. Requirements :- Software Download Link Java 6.0 http://www.oracle.com/ Eclipse Indigo http://www.eclipse.org/ Apache Tomcat 6.0 http://tomcat.apache.org/… Read More »

Restful Web Services in Java

There are two ways for the development of web-services in java. 1. SOAP – Simple Object Access Protocol For the development of SOAP web-services we use JAX-WS Standards, Apache Axis. SOAP web-services response will be always in XML format. 2. REST – Representational State Transfer For the development of REST web-services we use JAX-RS, Restlets,… Read More »

Design Patterns in Java

In this post we will know about the Design Patterns in Java. It is crucial to have the knowledge of Design Pattern for design/development of any software, mainly when working with object oriented design. What is Design Pattern ? Design Pattern is not a framework, it described the problem and provides a solution to that… Read More »

Get hours between dates

The simple way to get the number of hours difference between the two dates using java.util.Date is shown below. endDate.setHours() is deprecated so @SuppressWarnings(“deprecation”) is used above the main method. import java.util.Date; public class TimeCompare { /** * @param args */ @SuppressWarnings(“deprecation”) public static void main(String[] args) { Date startDate = new Date(); Date endDate… Read More »

New Features in Java5

Java 2 Platform Standard Edition 5.0(J2SE 5.0 / Java 5 /  JDK 1.5) is one of the major features release after 1.4. This was released under the code name Tiger on September 30, 2004 in order to improve the performance.These are most commonly used in our day to day programming. Below is the list of… Read More »

Synchronized and UnSynchronized

In multi threaded environment there is possibility of data getting altered when two or more threads accessing the same object. To prevent the concurrent access on the objects, the objects must be synchronized. Synchronized means thread-safe. Only one thread can work at a time on that object and the object will be in LOCK state for… Read More »