|
Page 7 of 14
The intValue() method returns a primitive type int value after
converting the numeric value wrapped by the invoking object to a
primitive type int. The intValue() method is an abstract method of the
Number class. Classes that extend the Number class implement the
intValue() method and provide......[read more]
The floatValue() method returns a primitive type float value after
converting the numeric value wrapped by the invoking object to a
primitive type float. The floatValue() method is an abstract method of
the Number class. Classes that extend the Number class implement the
floatValue() method and......[read more]
Numeric promotions are used to convert the operands in a numeric
expression to a common type before an operation is performed between
the operands. Numeric promotion is a property of the specific
definitions of the built-in operations and not a Java language feature.
It is applied to the operands......[read more]
The + operator concatenates two strings, producing a new String object as the result. For example,
String amt = "50";
String s = "John gave me " + amt + "dollars";
System.out.println(s);
This code will display the string "John gave me 50 dollars".
The + operator may also be used to......[read more]
The ?: operator is a conditional operator that is used as a short hand
for an if-else statement in some cases. It is also known as ternary
operator because it takes three operands. The general form of the
operator is as follows: opr1 ? opr2: opr3 where, opr1 can be any
expression that......[read more]
ArrayIndexOutOfBoundsException is an exception class that extends the
IndexOutOfBoundsException class. An object of type
ArrayIndexOutOfBoundsException is thrown at runtime to indicate that an
array has been accessed with an illegal index. The index (i.e. the
illegal index) used to access the......[read more]
Encapsulation is the mechanism that binds together data structure
(attributes) and behavior (operations) of an object into a single unit.
It keeps the internal implementation details of the object hidden from
other objects. In other words, encapsulation works as a protective
sheet that prevents......[read more]
The Vector class is used to create a generic dynamic array known as
vector. It is contained in the java.util package. It implements the
List interface. A vector can be created with or without explicitly
specifying its size. It can be expanded to hold more elements when
needed. As all classes in......[read more]
NumberFormatException is a subclass of the RuntimeException class. An
object of type NumberFormatException is thrown when an application
attempts to convert a string (that does not represent a number) into a
numeric type. ...[read more]
The == operator is generally used to check the equality of primitive
type values. It evaluates to true if the two values are the same.
Otherwise, it evaluates to false. The == comparison operator may also
be used to determine whether two object references refer to the same
object. It......[read more]
|