Volatile keyword in Java

java-thumbnail

This tips explains the use of volatile keyword in Java. The keyword volatile is used in the multithreaded environment. also read: Java Tutorials Java EE Tutorials Design Patterns Tutorials Java File IO Tutorials Local Variables in the Thread If you are working with the multithreaded programming, the volatile keyword will be more useful. When multiple […]

Working with arrays : java.util.Arrays class

java-thumbnail

The java.util.Arrays class is basically a set of static methods that are all useful for working with arrays. The Arrays class contains various methods for manipulating arrays (such as sorting and searching). In addition to that, it has got many utility methods for using with arrays such as a method for viewing arrays as lists […]

How to use Enum in Switch?

java-thumbnail

Enums introduced in Java 5.0 (Read: New features in Java 5.0) allows switching to be done based on the enums values. It is one of the greatest new features introduced from the version 5.0. Prior to Java 1.4, switch only worked with int, short, char, and byte values. However, since enums have a finite set of […]

Adding methods to an Enum

java-thumbnail

Enums introduced in Java 5.0 are just compiled java classes with some extra behavior. So you can basically do whatever you can in a normal java class inside an enum as well. That includes adding methods , class level variables and constructors to an enum. Adding methods to an enum works just like adding methods […]

What is transient keyword in Java?

java-thumbnail

This article explains about the transient variable and when it will be used in the Java programming. Another important fact is that, this question is most frequently asked in the Java interviews for checking the basic knowledge of a programmer. Another point is that this keyword is not frequently used by programmer in the normal […]

Ordering Queue Using Comparator Interface and PriorityQueue

java-thumbnail

The basic use of Queue class is to provide a data structure which allows storing objects in a First in First out(FIFO) format. But sometimes one wants to maintain the ordering, based on some other metric. This is exactly the purpose of PriorityQueue, another Queue implementation. You provide it a Comparator, and it does the […]

JBoss Portal Server Development

wildfly-thumbnail

Enterprises need more than just basic services; they need value-creating entities, which are crucial for running a successful business. Portals offer tremendous value to enterprises, and JBoss Portal Server is a popular, feature-rich open-source server that provides a standards-compliant platform for hosting functionality that serves the diverse portal needs of an enterprise. Its primary strength […]

load-on-startup element in web.xml

java-ee-thumbnail

This tips explains the few points on how to use the load-on-startup element on the web.xml file. Whenever is starting, it is possible to tell the container to load a servlet on the startup. You can load any number of servlets on the startup. Normally this is done for any initialization purpose. Look into the […]

Flex 3.0 Applications with BlazeDS in Eclipse

eclipse-thumbnail

Introduction BlazeDS is the server-based Java remoting and web messaging technology. BlazeDS enables Adobe Flex and Adobe AIR applications developers to easily connect to back-end distributed data and push data in real-time. BlazeDS makes use of AMF3 protocol which is similar to SOAP, but AMF3 protocol is a binary protocol and so is much faster […]

Servlets Interview Questions

1) Is it the “servlets” directory or the “servlet” directory? For Java Web Server: on the file system, it’s “servlets” c:\JavaWebServer1.1\servlets\DateServlet.class in a URL path, it’s “servlet” http://www.stinky.com/servlet/DateServlet 2) How do I support both GET and POST protocol from the same Servlet? The easy way is, just support POST, then have your doGet method call […]