4th Six Weeks Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

Disjuction/Or (||) table

A

T and T: T
T and F: T
F and T: T
F and F: F

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Conjunction/And (&&) table

A

T and T: T
T and F: F
F and T: F
F and F: F

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Negation/Not (!) table

A

T: F
F: T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Bitwise and Bit Shift Operators

A

The Java programming language also provides operators that perform bitwise and bit shift operations on integral types. The operators discussed in this section are less commonly used. Therefore, their coverage is brief; the intent is to simply make you aware that these operators exist.

The unary bitwise complement operator “~” inverts a bit pattern; it can be applied to any of the integral types, making every “0” a “1” and every “1” a “0”. For example, a byte contains 8 bits; applying this operator to a value whose bit pattern is “00000000” would change its pattern to “11111111”.

The signed left shift operator “<>” shifts a bit pattern to the right. The bit pattern is given by the left-hand operand, and the number of positions to shift by the right-hand operand. The unsigned right shift operator “»>” shifts a zero into the leftmost position, while the leftmost position after “»” depends on sign extension.

The bitwise & operator performs a bitwise AND operation.
The bitwise ^ operator performs a bitwise exclusive OR operation.
The bitwise | operator performs a bitwise inclusive OR operation.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Percent sign

A

The percent sign in Java is the modulus operator. Modulus is used to find the remainder from a division.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly