File Upload and Download is always a handy utility to know. There will be some need to upload a file to an FTP server, Like if you generate a report or store some data in .xls file, then it needs to be uploaded to a FTP server for further use. like wise we need to …
Java
Precise rounding of decimals using Rounding Mode Enumeration
The Rounding Mode Enum in java.math package is used to perform precise rounding of decimal values. It was introduced in Java 5.0. This Enum provides various constants each of which is used for different modes of rounding. The decimal value would be rounded off to the number of decimal places based on the scale that …
Passing arguments and properties from command line
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 …
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 …
HashCode and equals methods
HashTable, HashMap and HashSet are the Collection classes in java.util package that make use of hashing algorithm to store objects. In all these Collection classes except HashSet, objects are stored as key-value pairs. For the storage and the retrieval of any user-defined objects it is a good practice to override the following methods which is …
Generics in Java 5.0
1) Introduction The feature of Generics in Java allows Applications to create classes and objects that can operate on any defined types. Programmers can now make use of the Generics feature for a much better code. There is no need for un-necessary casting when dealing with Objects in a Collection. This article provides a detailed …
New Features in Java 5.0
1) Introduction Java 5.0 comes with a bunch of useful features. In this article, we are going to have an overview of the features like Enhanced for-loop, Variable Arguments, Static Imports and Enumerations. Apart from these features, we have already published other notable features in Java 5.0, auto boxing, generics and annotations. If you are …
Annotations in Java 5.0
1) Introduction Annotations in Java is all about adding meta-data facility to the Java Elements. Like Classes, Interfaces or Enums, Annotations define a type in Java and they can be applied to several Java Elements. Tools which will read and interpret the Annotations will implement a lot of functionalities from the meta-information obtained. For example, …