1. !(a>3) is equivalent to a). a<3 b) a <= 3 c) !a < 3 d) !a <= 3 e) !(a<=3) 2.
ID: 3539073 • Letter: 1
Question
1. !(a>3) is equivalent to
a). a<3
b) a <= 3
c) !a < 3
d) !a <= 3
e) !(a<=3)
2. Which of the following expresses the condition: a is less than b and c
a) a < b || a < c
b) a < b && c
c) a < b && a < c
3. A special value that the user enters to signal the end of the input is called
a) an input value
b) a user va;ue
c) a sentinal value
d) a looping value
4. When you use a while loop to compute the sum of several values, you should initialize the variables holding the sum to
a) 0
b) 1
c) NULL
d) There is no need to initialize
5. Assuming the for loop header for (i=0, i<=7; i++), what will be value of i after we exit the loop?
6. the data type of the return value of the equals method is
a) object
b) boolean
c)equals
d) class
7. When class B inherits from class A?
a) A is the superclass and B is the subclass
b) A is the subclass and B isthe superclass
8. Assuming that ckass B inherits from class A and method foo belonds to class A, what do we mean by overriding method foo in class B?
a) We are calling method foo in class B
b) We are not using method foo in class B
c) We are coding another version of method foo in class B
9. Contructors
a) Are inherited but cannot be accessed
b) are inheritied and can be accessed
c) Are accessible but are not inherited
d) Are not inherited and cannot be accessed
10. An abstract method
a) has a do nothing body b) does not have a body c) has a body, just like another method
11. What keyword do we use in the class header that inherits from an interface?
12. When a class implements an interface
a) it does not have to implement the abstract methods of the interface
b) it has to implement at least one of the abstract methods of the interface but not all of them
c) It has to implement all f the abstrtact methods of the interface
13. When we open a file for appending and the file does not exist
a) Compiler error b) runtime error c) file will be created
14. When we open a file for appending and file exists
a) compiler error b) runtime error c) file contents overwritten d) adding data to end of file
15. T OR F (In a stack represented by a linked list, we insert, or push, at the beginning of the list)
16. T OR F (Unless we run out of memory, we can always insert in a linked list)
17. T OR F (The swing components are often referred to as a lightweight components)
18. T OR F (We can only have one component inside a JFrame)
19. T OR F (Layout managers enable us to control how components are geographically located inside a window)
20. A stack uses
a) Last in last out b) last in first out c) first in last out d) first in first out
21. A queue uses
a) Last in last out b) last in first out c) first in last out d) first in first out
22. What method is used to set the width and height of a window
a) setWindow b)setWidthHeight c) setHeightWidth d) setSize
23. If you want to disable a component, what method do you use?
a) disabled b) enabled c) setdisabled d) setenabled
Explanation / Answer
1) b) a <= 3
2)c) a < b && a < c
3)c) a sentinal value
4) a) 0
5) i=8
6) b) boolean
7) a) A is the superclass and B is the subclass
8) c) We are coding another version of method foo in class B
9)c) Are accessible but are not inherited
10) b) does not have a body
11) implements
12) C. It has to implement all of the abstract methods of the interface.
13) c) file will be created
14)b) runtime error
15) T
16) T
17) T
18) F
19) T
20)b) last in first out
21)d) first in first out
22)d) setSize
23)d) setenabled
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.