Contact PSVM   (Q & A)  |  Notes Below   Audio  |  [toc]   [prev] Slide 7 of 13 [next]
SIJLesson14 Slide07
1, 2, 3, 4, 5, 6, [7 (top)], 8, 9, 10, 11, 12, 13, [Lab]

Notes for Slide 07
Java will not allow you to attempt to get the value
of a boolean variable until you put a value into it.
Notice that this is same as an int variable, but
different than a String variable.
The example program above on the left shows using a
set-statement to place a boolean value into the pass variable
based on an input value which itself is stored in an
int variable named score.
The erroneous program above on the right shows a
second statement that is not acceptable Java because the
pass variable would be empty when the second statement runs.


1, 2, 3, 4, 5, 6, [7 (top)], 8, 9, 10, 11, 12, 13, [Lab]