Tagged: #java

How to setup java on unix

How to setup java on unix

This is a step-by-step guide to install java (JRE) on unix machine. Step-1 Download Java Download the appropriate tar.gz JRE package from oracle, choose the package which suits your system specifications...

How to setup java on windows

How to setup java on windows

This is a step-by-step guide to install java (JRE) on windows machine. Step-1 Download Java Download the appropriate JRE package from oracle, choose the package which suits your windows specifications...

Pass data from html to servlet

Pass data from html to servlet

In this tutorial we explain the common way of passing data from html to java servlets, we mostly focus on passing form data entered by end-users through pages like: login, sign-up,...

JSP - Hello World Tutorial

JSP – Hello World Tutorial

In this tutorial, we provide a step-by-step guide for creating a hello world web application using JSP technology. Prerequisites: Eclipse IDE (Mars release) Java 1.7 Apache tomcat 7 1. Create...

Servlet 3.0 - Hello World Tutorial

Servlet 3.0 – Hello World Tutorial

In this tutorial, we provide a step-by-step guide for creating a hello world web application using Servlet 3.0 technology. Servlet 3.0 supports defining and exposing servlets using annotations, if you...

Servlet 2.5 - Hello World Tutorial

Servlet 2.5 – Hello World Tutorial

In this tutorial, we provide a step-by-step guide for creating a hello world web application using Servlet 2.x technology. Prerequisites: Eclipse IDE (Mars release) Java 1.7 Apache tomcat 7 1....

StringBuilder VS StringBuffer

StringBuilder VS StringBuffer

Since String is immutable, it is very costly to use it when constructing a dynamic character string due to the fact that a new memory location will be allocated at...

Java try-with-resources

Java try-with-resources

Java 7 supports a new statement called try-with-resources which extends the behavior of the traditional try/catch block for the sake of automatic resource management, since Java 7 developers are able...

Exception handling strategy

Exception handling strategy

In this article we introduce a common strategy for handling exceptions in an OOP application, our strategy conforms to the best exception handling techniques and can be integrated in any...

How to use exceptions effectively

How to use exceptions effectively

Exception is an event which occurs during the execution of a program and disrupts its normal flow, it is mainly arrised from different kind of situations such as wrong user...

Define an abstract property in java

Define an abstract property in java

Abstract keyword is normally applied on classes and methods in order to delegate the implementation of some behavior to subclasses. Java doesn’t support abstract properties, if you try to mark...

Static keyword in java

Static keyword in java

Every instance of a class has its own state and behavior, whenever the state of a particular instance is modified, other instances are not affected. In java, a static keyword...

How to use Enums in java

How to use Enums in java

In this article, we provide several examples on the usage of Enums in java. 1. Overview of Enum Enum is a java type/class which holds a fixed set of related...

How to create an immutable class in java

How to create an immutable class in java

An object is immutable if its state cannot change after construction, immutable objects don’t expose any way for other objects to modify their state, the object’s fields are initialized only...

Working with hashcode() and equals() in java

Working with hashcode() and equals() in java

By default, the java super class java.lang.Object provides 2 important methods: equals() and hashcode() for comparing objects, these methods become very useful when implementing large business which requires interactions between several classes. In...

Web service project structure

Web service project structure

In this article we introduce the most common way for structuring a maintainable web service, our example can be used as a template for creating any web service using object oriented...