Java Reference
In-Depth Information
Double.MIN_VALUE + 1
Double.MAX_VALUE Double.MAX_VALUE - 1
Double.MAX_VALUE + 1
SR3. Evaluate the following expressions to become familiar with casting
between int and double and the precedence of the casting operators.
5+2.0
7/( double )4
2*(7%4)
5.0 + 2
( double )7/4
2*( double )(7%4)
(7 / 4) * 5
( double )(7/4)
2*(( double )7%4)
(7 / 4.0) * 5
2 * (7 % ( double )4)
( int )5 ( int )( double )4
( int ) 5.3 ( int )( double ) 4.3
( int ) 5.9 ( double )( int ) 4.3
( int ) -5.3 ( int )( int ) 4.3
( int ) -5.9 ( double )( double )4
SR4. Type the following expressions into your IDE and see what their values are
to become familiar type boolean .
true
true && false
true || false
false
true && true
true || true
! true
false && false
false || false
! false !! true
true && false && true
true || false || true
true && ! false && true
true || true && false
true || false && true
true && true || false
true || ( false && true )
true && ( true || false )
( true || false )&& true
( true && true )|| false
true || true && false
SR5. Type the following expressions into your IDE and see what their values are
to become familiar with String s.
"Truth " + "is" + "best"
("Truth " + "is") + "best"
"Truth " + ("is" + "best")
56 + "" + 56
SR6. Type the following expressions into your IDE and see what their values are
to become familiar with precedences of operators.
"" + 4 / 2
("" + 4) / 2
"" + (4 / 2)
""+4+2
""+(4+2)
(""+4)+2
4+2+""
4+(2+"")
4+2<6
4+2<4+3
4<3==3<4
4<3== true || false
4<=4&&2<4
4<3!= true && false
 
Search WWH ::




Custom Search