
IB Option D HL
Quiz
•
Computers
•
12th Grade
•
Medium
Robert Morrison
Used 8+ times
FREE Resource
9 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Choose the best definition of 'object reference'
A variable that contains an object
A variable that points to an object
A variable that instantiates an object
A unique hash code that identifies a particular object in memory
2.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
Which statements about recursion are correct?
Recursive algorithms must have a base case and a general case
Recursion is rarely used in practice (in the context of high-level programming)
Recursive algorithms are somewhat memory-intensive
There are some problems for which the solution can be expressed much more simply with recursion
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Presume a is an object reference. z is a new object reference, which is initially assigned to a. Which statement is most correct?
z will always reference the same object as a
z references a different object that is an identical copy of the object referenced by a
z references the same object as a, but if a is reassigned, z will continue to reference the original object
z references a different object than a, but of the same class
4.
DRAG AND DROP QUESTION
1 min • 1 pt
ArrayList and LinkedList are two classes which (a) the (b) (c) . As a result, they have the same (d) . The underlying implementation of these two classes is (e) , but they can be used in an identical way.
5.
FILL IN THE BLANK QUESTION
1 min • 1 pt
You are defining a Node class for a singly linked list. Write the line of code that defines a pointer to the subsequent Node as an instance variable. Use the object reference 'next'. Do not initialise the instance variable.
6.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
Which of the following are considered good software development practices?
Using existing library classes instead of manually re-implementing existing functionality
Making use of indentation and spacing to aid readability
Writing methods using as few lines of code as possible
Ensuring the precise function of all code is described clearly through comments
Answer explanation
Code should be self-documenting through use of modularity, meaningful identifiers and short, clear code statements. Comments should only be used sparingly, or to produce class documentation (e.g. Javadoc)
Code should be as clear as possible - the number of lines doesn't matter (within reason). In many cases, one action per line is much clearer and will execute just as efficiently as a single long, complex line of code that performs many functions.
7.
MATCH QUESTION
1 min • 1 pt
Match the following List interface methods with their description
Inserts item at position index
size()
Inserts item to the end of the list
return(int index)
Returns the number of items in the List
add(int index, Object item)
Not a real List method!
add(Object item)
Deletes the item at position index
remove(int index)
8.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
Which statements about data structures are true?
Arrays are a primitive type
ArrayList and LinkedList are more efficient than arrays. Arrays should be avoided.
Arrays are normally the most efficient way of storing data where the size is static and known in advance.
List types can only store object references, whereas arrays can store both primitive types and object references.
9.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
z is an object reference which is passed to a method to replace the formal parameter (argument) x. Which statement is true?
If x is reassigned to a different object in the method, z is also reassigned to that object
If the object referenced by x has its state changed by the method, the object referenced by z will be unaffected
If the object referenced by x has its state changed by the method, the object referenced by z will also be affected (because it is the same object).
It is impossible for the method to make any changes to z or x, since java uses pass-by-value mechanisms.
Similar Resources on Wayground
10 questions
Server Administration- Quiz 1
Quiz
•
12th Grade - University
10 questions
Quiz 9 (15.09.2021)
Quiz
•
1st - 12th Grade
10 questions
RPMS - IPCRF by Jenelou John Israel
Quiz
•
12th Grade
10 questions
YouCode Scratch Quiz
Quiz
•
KG - 12th Grade
10 questions
Windows 10 Basics
Quiz
•
9th - 12th Grade
10 questions
Data Engineering y BigQuery V1
Quiz
•
12th Grade
13 questions
RAM&HDD/SSD
Quiz
•
10th - 12th Grade
10 questions
EMPTECH L4 Q2
Quiz
•
12th Grade
Popular Resources on Wayground
20 questions
Brand Labels
Quiz
•
5th - 12th Grade
11 questions
NEASC Extended Advisory
Lesson
•
9th - 12th Grade
10 questions
Ice Breaker Trivia: Food from Around the World
Quiz
•
3rd - 12th Grade
10 questions
Boomer ⚡ Zoomer - Holiday Movies
Quiz
•
KG - University
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
Adding Integers
Quiz
•
6th Grade
10 questions
Multiplication and Division Unknowns
Quiz
•
3rd Grade
20 questions
Multiplying and Dividing Integers
Quiz
•
7th Grade