THE Java™ Programming Language, Fourth Edition
while this invocation returns false: sameArgs(3, new Integer(3)) An implementation of the virtual machine may choose to expand o ...
The exact actions of the binary arithmetic operators depend on the types of operands involved. The following sections look at th ...
Multiplying infinity by zero yields NaN. Multiplying infinity by a non-zero finite number produces an infinity of the appropriat ...
Non-strict floating-point execution allows intermediate results within expressions to take on values with a greater range than a ...
The output is 17 17 18 The expression ++i preincrements the value of i to 17 and evaluates to that value (17); the expression i+ ...
differentSign(); The equality operators can also be applied to reference types. The expression ref1==ref2 is true if the two ref ...
if (x == true || y == false) { // ... } The && ("conditional AND") and || ("conditional OR") operators perform the same ...
either bit is 1, and the XOR of two bits yields a 1 only if the two bits have different values. For example: 0xf00f & 0x0ff0 ...
Shift operators can be used only on integer types. In the rare circumstance when you actually need to manipulate the bits in a f ...
Cloneable would be the type of the expression; if one expression was int while the other was String, then Object would be the re ...
except that the expression on the left-hand side of the assignment is evaluated only once. In the example, arr[where()] is evalu ...
And here is its output: boohoo! The + operator is interpreted as the string concatenation operator whenever at least one of its ...
occursbecause the value of those arguments is not needed to allocate memory for the objectin which case those arguments won't be ...
You can also use implicit widening conversion of integer types to floating-point, but not vice versa. There is no loss of range ...
optionally followed by a widening reference conversion; or an unboxing conversion optionally followed by a widening primitive co ...
type, dropping the upper bits changes the value, including possibly changing sign. The code short s = -134; byte b = (byte) s; S ...
This implicit conversion of primitive types and objects to strings happens only when you're using + or += in expressions involvi ...
creation or cast new (type)expr multiplicative * / % additive + - shift << >> >>> relational < > > ...
3 << 2L - 1 (3L << 2) - 1 10 < 12 == 6 > 17 10 << 12 == 6 >> 17 13.5e-1 % Float.POSITIVE_INFINITY ...
at the point where the code invokes the method. That method will be defined in a particular class or interface, and that is the ...
«
5
6
7
8
9
10
11
12
13
14
»
Free download pdf