Arguments and properties can be passed to a java application from command line. In this techical tip, let us see how to pass arguments as well as properties from command line. also read: Java Tutorials Java EE Tutorials Design Patterns Tutorials Java File IO Tutorials Passing arguments from command line The syntax to pass arguments …
Generation of Random Numbers
Random numbers in java can be generated either by using the Random class in java.util package or by using the random() method in the Math class in java.lang package. also read: Java Tutorials Java EE Tutorials Design Patterns Tutorials Java File IO Tutorials In both these approaches, we only get a pseudo random number and …
What is Hibernate Caching?
1. Introduction While working with Hibernate web applications we will face so many problems in its performance due to database traffic. That to when the database traffic is very heavy . Actually hibernate is well used just because of its high performance only. So some techniques are necessary to maintain its performance. Hibernate Caching is …
Parsing Input using Scanner
A Scanner object can be used to read text input from a number of sources. The input source can be a file, an input stream or even from a string. It internally uses the Regular Expression Api for parsing and getting the input. Let us see a simple example to parse a String object, also …
Parsing XML Documents using SAX
Xml Parsers are used to parse and extract information from Xml Documents. The most commonly used Xml Parsers are Simple API for Xml Parsing and Document Object Model. SAX Parsers are preferred when the size of the Xml Document is comparatively large and the application doesn’t wish to store and reuse the Xml information in …
Recursively traversing files and folders using Java File API
In this section, let us see how to recursively traverse over files and folders by making use of Java File API. Whether it is a folder or a file, both are represented as a java.io.File object. For example, consider the following code snippet, also read: Java Tutorials Java EE Tutorials Design Patterns Tutorials Java File …
Querying Class Information at Runtime using Java Reflection API
Java Reflection API provides support for querying information about a class at run-time. This information includes the list of public as well as private members (methods) available for the class, the various public operations it supports etc. This section will guide you in making use of the Reflection API. Suppose we have the following test class …
Storing Application Data using Preferences API
Applications can now make use of the Java Preferences API for storing and retrieving Application related data. The location where the Data gets stored is implementation specific. Two levels of Preferences come into picture, one is the User Preferences for storing user information and the other is the System Preferences that deals with information common …