Search 12506 Results
Suppose we want to convert a user-specified weight in pounds to a different unit of measure, such as kilograms, carats, or ounces.
To add a property to an enumeration constant, we would need to define its constructor.
In the previous post, we have seen why we need Enums in java, we have seen how to create integer patterns for Enumerations.
Oftentimes, we need a fixed set of constants in our application. Examples might include the days of the week and the colors in a rainbow.
We have covered how to persist the object state to a disk file. In many situations, the classes in a program evolve over time.
A Serializable object may contain references to other objects. We may be wondering if we serialize an object, whether the nested objects are also seri
A program that illustrates the use of the Externalizable interface is given here. Note that the program uses Java’s security API. We need not worry ab
In the previous posts, we saw how to store and retrieve the objects using Serialization. We’ll now look at another very important technique for storin
The StreamTokenizer is another very useful class that parses an input stream into tokens. This class is not derived from InputStream or OutputStream.
So far we have been using System.out to print messages to the console. Java SE 6 added a Console class to enhance and simplify command-line applicatio
This is a very convenient class that has the ability to print representations of various data values, such as all primitive types. During printing it
If we are working with binary data such as images and sounds, we need to use binary mode files.
You need to log in or register to vote on answers or questions.