Midterm Multiple Choice Flashcards Preview

Comp 401 > Midterm Multiple Choice > Flashcards

Flashcards in Midterm Multiple Choice Deck (20):
1

Which of these are NOT a value type?
a) int
b) null
c) boolean
d) String
e) double[]

null, String and double[] are not value types

2

Which of these statements are true of an expression?
a) A string is not an expression.
b) An expression always results in a value.
c) A literal integer is a valid expression.
d) Expressions can not be combined using mathematical operators.
e) A void method call can be part of an expression.

b, c

3

Which of these statements are true of loops?
a) A for loop can always be written as a while loop.
b) The keyword end can be used to immediately exit the loop body.
c) A loop cannot contain another loop
d) The body of a loop will execute at least once.
e) A switch statement is a type of loop

a

4

Which of the following are true of methods?
a)
b)
c)
d)
e)

w

5

a)
b)
c)
d)
e)

q

6

a)
b)
c)
d)
e)

q

7

a)
b)
c)
d)
e)

q

8

a)
b)
c)
d)
e)

q

9

a)
b)
c)
d)
e)

q

10

a)
b)
c)
d)
e)

q

11

a)
b)
c)
d)
e)

q

12

a)
b)
c)
d)
e)

q

13

a)
b)
c)
d)
e)

q

14

a)
b)
c)
d)
e)

q

15

a)
b)
c)
d)
e)

q

16

a)
b)
c)
d)
e)

qq

17

a)
b)
c)
d)
e)

q

18

a)
b)
c)
d)
e)

q

19

a)
b)
c)
d)
e)

qq

20

a)
b)
c)
d)
e)

q