CS402 Exam 1 Review
Quiz by Elaina Wittmer
Feel free to use or edit a copy
includes Teacher and Student dashboards
Measure skillsfrom any curriculum
Tag the questions with any skills you have. Your dashboard will track each student's mastery of each skill.
- edit the questions
- save a copy for later
- start a class game
- automatically assign follow-up activities based on students’ scores
- assign as homework
- share a link with colleagues
- print as a bubble sheet
- Q1
The root of the Java Object Hierarchy is Object
truefalseTrue or False15s - Q2
Which of the following is not included when checking for equality?
Null check
Type Check
Field check
Method check
30s - Q3
A java class is stored in which type of file?
.ctxt
.j
.java
.class
20s - Q4
ArrayLists can contain Objects or primitive types
falsetrueTrue or False30s - Q5
Classes can inherit from multiple parents in Java
falsetrueTrue or False20s - Q6
Which of these is a valid way to initialize an empty ArrayList with a size of 400?
ArrayList<integer>(400) arrayList = new ArrayList<integer>();
ArrayList<integer> arrayList = new ArrayList<integer>(400);
ArrayList<Integer> arrayList = new ArrayList<Integer>(400);
ArrayList<integer> arrayList = new ArrayList<integer>(400);
60s - Q7
A class is a blueprint for creating objects
truefalseTrue or False60s - Q8
Group the following into classes and objects
Users sort answers between categoriesSorting60s - Q9
Private methods can be accessed by other classes in the same directory.
falsetrueTrue or False20s - Q10
What is the difference between the size and length of an ArrayList?
Length = amount of allocated memory, size = number of items in array
Length = number of items in array, size = amount of allocated memory
20s - Q11
ArrayLists have a length of 10 by default
truefalseTrue or False20s - Q12
What data type does this method return?
int
void
Rectangle
ArrayList
20s - Q13
What is the correct order of sections in a UML diagram (as shown in class)?
Users link answersLinking30s - Q14
Java allows multiple methods within a class to have the same name
truefalseTrue or False20s - Q15
Complete the body of this loop to print every odd digit between 0 and 50. Assume integer i has not yet been initialized.
for (<fill in this part>) {System.out.println(i);}
Users enter free textType an Answer30s