Review and quick notes:
- What is the difference between compiling and running a program?
- Name 5 common built-in types also known as primitive data types.
- What are the differences and similarities between char and Strings?
- What java type is used to represent a Real Number?
- Draw the truth table for && and || for two boolean variables a and b.
- Show the truth table for the following expression:
!( p && ( q || !r))
for the following values of p, q, and r
f f f
f f t
f t f
f t t
t f f
t f t - Write a code snippet to determine if a number is even.
- How do you display a quote as part of a string?
- How do you display a backslash as part of a string?
- When all the operations in an expression have the same precedence how does the java compiler evaluates the expression?
- What does each of the following print? Explain
- System.out.println(2 + "bc"); prints: 2bc
- System.out.println(2 + 3 + "bc"); prints: 5bc
- System.out.println((2+3) + "bc"); prints: 5bc
- System.out.println("bc" + (2+3)); prints: bc5
- System.out.println("bc" + 2 + 3); prints: bc23
- What is the value of Integer.MAX_VALUE?
Some Help
#5
a b a && b a || b
f f
t f
f t
t t
#6
p q r q || !r !( p && ( q || !r))
f f f
f f t
f t f
f t t
t f f
t f t