|
Page 5 of 14
Variable length arguments are used to declare a method that takes a
variable number of arguments. This is one of the features added in the
J2SE 5 version. Varargs are declared using a data type followed by
three periods (...). An example of variable length arguments is as
follows: public void......[read more]
The run() method belongs to the Runnable interface. It is used to instantiate a new thread.
The signature of the run() method is as follows:
public void run()
The run() method is very similar to the main() method, as it is the entry point for a thread. The run() method can be......[read more]
In Java, wildcards mean unknown types. They are represented using the ?
symbol. Wildcards are used in Java to provide flexibility of using
different type parameters with the generics code. Wildcards are of the
following two types: Unbounded wildcards: These are the wildcards
without......[read more]
Static import is a new feature introduced in j2SE 5.0. It allows the
static members of the imported class to be treated as if they were
declared in the class that uses them. It is now no longer required to
use the static class name and dot operator as was required before.
Static imports are of......[read more]
The Runnable interface is defined in the java.lang package. The
Runnable interface contains a single method named run(). The signature
of the method in the Runnable interface is given below: public void
run(); A class that implements the Runnable interface provides the body
of the run()......[read more]
The bitwise left shift operator shifts the bits of its left operand to
the left side by using the number of positions specified by its right
operand. For each shift operation, a zero bit is pushed into the
lower-order (rightmost) bit position, and the higher-order (leftmost)
bit is pushed out (or......[read more]
The bitwise right shift operator shifts the bits of its left operand to
the right-hand side by using the number of positions specified by its
right operand. For each shift operation, the lower-order (rightmost)
bit of the left operand is shifted off and discarded, and its leftmost
bit position......[read more]
The toHexString() method converts an integer value into a hexadecimal
string. The Long class defines this method with the following
signature: public static String toHexString(long L) The given signature
of the method suggests that it takes a long argument and returns a
String object.......[read more]
Inheritance is a process by which objects of a class acquire the
properties of the objects of another class. It supports the concept of
hierarchical classification. It not only allows objects to be reused,
but also allows the creation of new objects by extending the existing
ones. By using the......[read more]
The toHexString() method converts an integer value into a hexadecimal
string. The Integer class defines this method with the following
signature: public static String toHexString(int i) The given signature
of the method suggests that it takes an int argument and returns a
String object.......[read more]
|