Sams Teach Yourself Java™ in 24 Hours (Covering Java 7 and Android)

(singke) #1
ptg7068951

Workshop 63

Workshop


Te s t y o u r k n o w l e d g e o f v a r i a b l e s ,expressions,and the rest of the information
in this hour by answering the following questions.


Quiz



  1. What do you call a group of statements that is contained with an open-
    ing bracket and a closing bracket?
    A. A block statement
    B. Groupware
    C. Bracketed statements

  2. Abooleanvariable is used to store trueorfalsevalues.
    A. Tr u e
    B. False
    C. No,thanks. I already ate.

  3. What characters cannot be used to start a variable name?
    A. A dollar sign
    B. Tw o f o r wa r d s l a s h m a r k s (//)
    C. A letter


Answers



  1. A.The grouped statements are called a block statementor a block.

  2. A.trueandfalseare the only answers a booleanvariable can store.

  3. B.Variables can star t with a letter,a dollar sign ($), or an underscore
    character (_). If you started a variable name with two slash marks,the
    rest of the line would be ignored because the slash marks are used to
    start a comment line.

Free download pdf