|
Page 4 of 14
The Externalizable interface allows a programmer to have a complete
control over the serialization and deserialization processes. The
Externalizable interface has the following two methods: public void
writeExternal(ObjectOutput objout) : This method is used to save the
contents of an......[read more]
Pattern is a final class present in the java.util.regex package. It is
used to define and hold regular expressions. This class works with the
Matcher class to perform the match operations. The Pattern class
defines no public constructors. To create a pattern, a static method
compile is used......[read more]
A static initializer block is a free hanging block in a Java class. It
is used mainly for initialization. It is very similar to a constructor,
but it cannot be inherited. The static initializer block is declared as
follows: static { int i = 5; ......[read more]
A covariant return allows a class to override the return type of a
method it inherits from a super class. Using the covariant return
feature, a method in a subclass may return an object whose type is a
subclass of the type returned by the method with the same signature in
the superclass. This......[read more]
The Set interface extends the Collection interface and does not allow
duplicate elements to be added to itself. If an attempt is made to add
a duplicate element, its add() method returns false. The elements of a
Set are not necessarily sorted. This interface does not define any
method of its own......[read more]
Autoboxing is the automatic conversion of numeric objects to
primitives. Prior to Java 5, it was necessary to wrap a primitive type
to a Wrapper class before adding it to a collection, and to unwrap it
back to the primitive when it came out of the collection. By the
introduction of autoboxing,......[read more]
A File class is used to access the file and directory objects. This
class provides numerous access methods for performing all common file
and directory operations. These methods enable files and directories to
be created, deleted, renamed, and listed. However, the File class does
not provide any......[read more]
The FileInputStream class is used to perform simple file input
operations. It is used to read binary data from a file. It reads data
in a sequential manner but can skip a region of data as per the
requirement. The FileInputStream class can be instantiated by using any
of the following three......[read more]
The Locale class is used to represent an object that describes a
geographical, cultural, or political region. This class is particularly
useful for internationalization. Each region has different formats to
present the date, time, and numbers. The Locale class is used to
present these formats.......[read more]
An assertion is a statement that is assumed to be true during the
execution of a program. It returns a Boolean result. If the result is
true, the code executes normally and no other action takes place. This
confirms that the assumed statement is true. If the result is false, an
AssertionError is......[read more]
|