10 Example of jQuery Selectors for Web Developers

I am primarily a Java developer but I have done a lot of work with Java web applications including Servlet, JSP, and JavaScript on the client-side. It was difficult for me to perform client-side validation using JavaScript but ever since I come to know about jQuery, I simply love to do more validation and other stuff on the client-side. The jQuery gives you immense power to do things with HTML pages and half of that power comes from its CSS-like selector engine, which allows you to select any element or group of elements from the HTML page and then do things with them e.g. changes their style or behavior. For example, you can grab the divs and hide them, you can grab the buttons and make them clickable, and so on. 

DOM vs SAX Parser in Java - XML Parsing in Java

DOM vs SAX parser in Java
DOM and SAX parser are two most popular parser used in Java programming language to parse XML documents. DOM and SAX concept are originally XML concept and Java programming language just provide an API to implement these parser. Despite both DOM and SAX are used in XML parsing, they are completely different to each other. In fact difference between DOM and SAX parser is a popular Java interview question asked during Java and XML interviews. DOM and SAX parser has different way of working, which makes Java programmer to understand difference between DOM and SAX parser even more important.

How to use Queue Collection in Java? An example Tutorial

The JDK provides an implementation of several data structure in Java collection framework, e.g., ArrayList is a dynamic array, LinkedList represents a linked list, HashMap represents a hash table data structure, and Queue interface represent queue data structure. Btw, If you are not familiar with data structure itself, then you can also see Introduction to Data Structures & Algorithms in Java, an excellent course to start with the essential data structure in Java. The Queue data structure allows you to process elements in the first in first out order, and that's why it is also known as a FIFO data structure. In order to provide first in primary out functionality, it allows you to insert data at one end and delete data from other ends, also known as consuming data. If you need to process objects in the FIFO order, you can use a Queue to store them.

What is blank final variable in Java - Example

What is blank final variable in Java
Blank final variable in Java is a final variable which is not initialized while declaration, instead they are initialized in a constructor. Java compiler will complain if a blank final variable is not initialized during construction. If you have more than one constructor or overloaded constructor in your class then blank final variable must be initialized in all of them, failing to do so is a compile time error in Java. Alternatively, you can use constructor chaining to call one constructor from other using this keyword, in order to delegate initialization of blank final variable in Java. In this Java tutorial, we will see What is blank final variable in Java and a code example on How to use a blank final variable.

How to write a Generic method in Java

A method is called generic method if you can pass any type of parameter to it and it will function the same e.g. it allows the same logic to be applied to different types. It's known as a type-safe method as well.

1) You can declare Generic methods not only on Generic or parameterized class but also on regular classes which not generic.

2) The type declaration like <T> should come after modifiers like public static but before return type like the void, int, or float. Here is an example of a generic or parameterized method declaration

public static <T> void swap(T a, T b){


Eclipse Netbeans Keyboard Shortcut Mapping for Java programmer

If you are a Java developer who has been using Eclipse for Java development, but you need to use Netbeans for your current project due to various reason,, then this article is for you. Whenever we transition between tools, we need the equivalent of one into other. For example, if you are Eclipse power user who is used to Ctrl + Shift + R and Ctrl + Shift + T then as soon as you start using Netbeans, you miss those shortcut. One thing to keep your productivity up is to quickly find the equivalent shortcut in a new tool, e.g., in Netbeans if you are switching from Eclipse or vice-versa. In this article, I am going to share the Netbeans equivalent of 10 useful Eclipse shortcuts for Java developers. You will benefit if you have to use any of these IDEs.

What is new in Java 7 - Top 5 JDK 7 feature

What is new in Java or JDK 7
It's close to a year now JDK 7 or Java 7 has been released, still programmer asks What is new in Java 7 ? What is the best feature introduced in JDK7, where is the list of all Java 7 new feature etc? I thought to let's document Top 5 new features introduced in Java 7 for easy reference, this will not only answer What is new in Java 7 but also provide a quick overview of What are those features in Java 7.  Java 7 introduced many new features in Java programming language like try catch with a resource, String in Switch etc but it also makes a lot of change on Java Development API by introducing new File API in Java and several other minor changes. E.g. you can now find hidden files from Java program without applying any hack. anyway let's see my list of Top 5 Java 7 features :