1. The main difference in operation between an ‘if statement and a ‘while’ statement is

A. the ‘while’ loop body is executed
B. the body of the ‘while’ statement may be executed many times, the body of the ‘if statements only once
C. the conditional expression following the keyboard is evaluated differently
D. All of the above
E. None of the above


Correct Answer:   B. the body of the ‘while’ statement may be executed many times, the body of the ‘if statements only once

2. If a class object is thrown with a throw statement, then a subsequent catch block has a usable match if the type of the catch argument is_________

A. a parent class of the thrown class
B. a child class of the thrown class
C. either (a) or (b)
D. neither (a) nor (b)


Correct Answer:  A. a parent class of the thrown class

3. The weakest form of cohesion is

A. coincidental
B. functional
C. logical
D. communicational


Correct Answer:  A. coincidental

4. The ‘continue’ statement is used to

A. permit two different expressions to appear in situations where only one expression would ordinarily be used
B. terminate loops or to exit from a switch
C. alter the normal sequence of program execution by transferring control to some other part of the program
D. All of the above
E. None of the above


Correct Answer:  E. None of the above

5. The ‘break’ statement is used to exist from

A. a do loop
B. a for loop
C. a switch statement
D. All of the above
E. None of the above


Correct Answer:  D. All of the above

Comments

No comments yet. Why don’t you start the discussion?

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    15 + five =