StringBuilder class in Java 5.0

java-thumbnail

java.lang.StringBuilder StringBuilder class is introduced in Java 5.0 version. This class is replacement for the existing StringBuffer class. If you look into the operations of the both the classes, there is no difference. also read: New Features in Java 5.0 Generics in Java 5.0 Annotations in Java 5.0 If you are using StringBuilder, no guarantee […]

Regular Expressions in Java

java-thumbnail

1) Introduction Regular Expressions are basically patterns of characters which are used to perform certain useful operations on the given input. The operations include finding particular text, replacing the text with some other text, or validating the given text. For example, we can use Regular Expression to check whether the user input is valid for […]

Precise rounding of decimals using Rounding Mode Enumeration

java-thumbnail

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 […]

Enhanced for-loop for User-defined objects

java-thumbnail

Enhanced For-loop is a new syntax for traversing over a collection of objects and it was introduced from Java 5.0. Let us see how Enhanced for-loop operates on user-defined Objects. The following example shows the syntax of using enhanced for-loop on a Collection object, also read: New Features in Java 5.0 Generics in Java 5.0 […]

Generics in Java 5.0

java-thumbnail

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

java-thumbnail

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 […]

AutoBoxing in Java 5.0

java-thumbnail

1)Introduction In the latest version of J2SE 5.0 released by Sun, Autoboxing is one of the new feature. Before J2SE 5.0, working with primitive types required the repetitive work of converting the primitive types into wrapper classes and vice – versa. Sometimes the purpose of conversion is just for some API call, after which the […]

Annotations in Java 5.0

java-thumbnail

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, […]