Working with DOM Attributes using jQuery


In the previous article we learned about manipulating CSS class using jQuery. In this article, we discuss about dealing with DOM attributes using jQuery. jQuery provides flexible methods to get or set DOM attributes and values of the matched elements, and to get or set property values of the matched elements and also to get […]

Creating Simple Web Application Using Apache Maven


In the previous post we saw how to create simple Java project using Maven. We will create a simple web application. The goal of this post is to highlight the basic features Maven provides to develop web applications. This post covers the following : Create simple web application using Maven Archetype plugin. Prepare the Tomcat […]

Example for a class implementing comparable interface in Java

When you need some sort of ordering for the classes which you define, you will be going either for a comparable or comparator interface. Consider this example package test; import java.util.*; public class TreeSetTest { private static Set<Person> s = new TreeSet<Person>(); public static void main(String a[]){ s.add(new Person(20)); s.add(new Person(30)); s.add(new Person(10)); s.add(new Person(50)); […]

Quartz Job Scheduler – Example Code


In this section we are going to develop a simple Quartz Scheduler application with the help of Quartz framework. That will display Hello World Quartz Scheduler :date & time on the console window after specified time schedule. Before using Scheduler you have to instantiate it. For doing this some users may keep an instance of […]

What is load on startup element in web.xml file

specify the order in which we want to initialize various Servlets. Like first initialize Servlet1 then Servlet2 and so on. This is accomplished by specifying a numeric value for theĀ  <load-on-startup> tag. <load-on-startup> tag specifies that the servlet should be loaded automatically when the web application is started. The value is a single positive integer, […]

Hibernate XML configuration file example

What is super and this keyword in java?

keyword : this ‘this’ is used for pointing the current class instance. It can be used with variables or methods. Look into the following example: class Test{ private int i=10; public void m(){ System.out.println(this.i); } } In the above code this is used for the current instance. Since this is instance of a class it […]

How to use BitWise shift operator in Java?

They are called shift operators and they operate by shifting the number of bits being specified as an operand in the operation. >> —> Right shift Operator << —> Left Shift Operator >>> —-> Right bit with zero fill operator. The first two maintain the MSB when shifting thereby they maintain the sign of the […]

What is difference between equals() and == ?

Explanation : 1 They both differ very much in their significance. equals() method is present in the java.lang.Object class and it is expected to check for the equivalence of the state of objects! That means, the contents of the objects. Whereas the ‘==’ operator is expected to check the actual object instances are same or […]

Difference Between List and ArrayList ?

List is an interface and ArrayList is an implementation of the List interface. The arraylist class has only a few methods in addition to the methods available in the List interface. There is not much difference in this. The only difference is, you are creating a reference of the parent interface in the first one […]