Author Archive


Constants in Java

Java language has a reserved word const intended for future use. However this keyword was never implemented and has no function. The original intent of the const keyword was to implement readable only references (which means a const reference cannot be used to modify object instance). However Java language designers decided NOT to implement this […]

Recursively Listing Files in a Directory in Java

Using the File class in Java IO package (java.io.File) you can recursively list all files and directories under a specific directory. There is no specific recursive search API in File class, however writing a recursive method is trivial. Recursively Listing Files in a Directory The following method uses a recursive method to list all files […]

How to Get List of Files in a Directory in Java

Java IO package (java.io) provides class named File which is abstraction of file and directory names. This class provides an abstract, system independent view of path names. The following sample Java program prints a list of files and folders in a specified directory. The program also uses File attributes to indicate whether a directory entry […]

Writing a Struts 2 Plugin

Struts 2 has built-in support for plugins which can extend the core framework functionality. Plugins can potentially add, replace or extend Struts 2 functionality. Whenever you want to share a set of reusable components across multiple Struts 2 Web applications, it is better to package them as plugins. Usually Struts 2 plugins are packaged as […]

Palindrome Program in Java

A string is called a Palindrome if it is spelled the same forward and backward. Following are some examples of palindrome strings, Madam, Noon, Rotor, Rotator, Radar, Malayalam Checking whether a string is palindrome or not is a common programming assignment given to programmers learning a new language. Checking Whether a String is a Palindrome […]