Chupane pe Chuphti nehin, Bhulane pe Bhulti nehin, Gum aisi marz hain mere Dost jiski Dawa Kahin milti nehin!!!
Coz I Still Haven't Found... What I'm Looking For
10 years ago
Operators | Precedence |
---|---|
postfix | expr++ expr-- |
unary | ++expr --expr +expr -expr ~ ! |
multiplicative | * / % |
additive | + - |
shift | << >> >>> |
relational | < > <= >= instanceof |
equality | == != |
bitwise AND | & |
bitwise exclusive OR | ^ |
bitwise inclusive OR | | |
logical AND | && |
logical OR | || |
ternary | ? : |
assignment | = += -= *= /= %= &= ^= |= <<= >>= >>>= |
int result = 1;
result--;// this means result = result-1; but after any operation done with result--
1-(result--) = 0;// the new result value is 0 but after the operation hence end result of the expression is 0
1 -(--result) = 1;// the new result value is 0 but before the operation hence end result of the expression is 1
check - http://download.oracle.com/javase/tutorial/java/nutsandbolts/op1.html for more clarity.
Data Type | Default Value (for fields) |
byte | 0 |
short | 0 |
int | 0 |
long | 0L |
float | 0.0f |
double | 0.0d |
char | '\u0000' |
String (or any object) | null |
boolean | false |
Similarly, you can declare arrays of other types:
byte[] anArrayOfBytes; short[] anArrayOfShorts; long[] anArrayOfLongs; float[] anArrayOfFloats; double[] anArrayOfDoubles; boolean[] anArrayOfBooleans; char[] anArrayOfChars; String[] anArrayOfStrings;
{"Smith", "Jones"}};