LATEST ARTICLE TAGGED ON "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.

Java 

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.

Java 

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.

Java 

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 

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

Java 

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.

Java 

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.

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

Java 

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.

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

Java 

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 

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.

NEWSLETTER

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