Autoboxing and Unboxing in Java

In the previous posts, we have just seen the use of type wrappers in wrapping the primitive data types. Beginning in J2SE 5.0, we will not have to explicitly perform such wrapping. The wrapping/unwrapping is now implicit and automatic.


Wrapper Classes: A Few Additions in J2SE 5.0 (Part-2)

The Character class that wraps a char data type provides several utility methods to operate on character data. We can test whether the given character is a digit, a letter, a lowercase character, and so on.


Wrapper Classes: A Few Additions in J2SE 5.0 (Part-1)

The type wrapper classes were provided in Java libraries since its first release. J2SE 5.0 made several useful additions to its methods. For example, the Integer class now provides methods for bit manipulations.


Wrapper Classes: Constructors and Methods

To wrap a primitive type into one of these classes, we use the provided class constructor. Generally, each of these classes provides two constructors:


Java I/O: Binary versus Character and Chaining Streams

If we are working with binary data such as images and sounds, we need to use binary mode files.


Exception Handling in Java: Classifying Exceptions

At the top of the Exception class hierarchy we have the Throwable class. All other exception classes, including our own designed exception classes, inherit from the Throwable class.


Interfaces in Java: Implementing Multiple Interfaces

In the previous post, we created a standard interface to get the fuel efficiency of a car. A car has many such standard functions that could be defined in terms of interfaces.

The static Keyword: Access Restrictions in Static Methods

Because a static method is invoked without a class instance, we cannot use a this or super reference in the static method.


The static Keyword: The static methods

Consider the example of the ball game described in here section. A player may be given the choice to select the colour of the balls. This colour choice will be applied to all the balls he creates during the game.

The static Keyword: More about static fields

In the previous post, we accessed the static method getCount by using the class name


The static Keyword: The static fields

We have already seen the use of the static keyword in our Java programs. In fact, the first program we encountered uses the static keyword, where it was applied to the main method.

Java  Class 

Inheritance in Java: Single-level and Multi-level Inheritance

When a class inherits from a single class, as in the case of BankAccount inheriting from Asset, it is called single-level inheritance or simply single inheritance.


Enter your email address here always to be updated. We promise not to spam!