Thursday, October 6, 2011

Escape Sequences

Escape sequences show up occasionally on the written test, but are convenient during the programming section of the test.
\t : tab
\b : backspace
\n : new line
\r : carriage return
\f : formfeed
\' : apostrophe
\" : quotation mark
\\ : backslash

Thursday, September 1, 2011

Rules of Java Arithmetic operations and signs

Using Numbers:
Division /
7 / 4 = 1
-7 / 4 = -1
7 / -4 = -1
-7 / -4 = +1

Remainder %
7 % 4 = 3
-7 % 4 = -3
7 % -4 = 3
-7 % -4 = -3

Using Signs:
Division /
+ / + = +
- / + = -
+ / - = -
- / - = +

Remainder %
+ % + = +
- % + = -
+ % - = +
- % - = -