Ultra
Ultra
Practice Questions
ANYS HADJIDJ
Your instructor has overridden the calculated test mark
Final Mark
Submitted 15/11/2024, 05:46 (GMT)
0 / 25
Assignment Content
B A compiler error
C false
Explain the difference between a referential check and an equality check in Java. Your answer
should describe how each type of check is performed and what it is used for.
Your Answer
Which of the following Java collections would you use if you need a collection that does not
allow duplicate elements and maintains elements in insertion order?
A TreeSet
B ArrayList
C LinkedHashSet
D HashSet
In the following code snippet there is a missing line where a HashMap is initialised and a key-
value pair is added.
Choose the correct code that would complete the snippet and allow it to print the value
associated with the key "name".
A False
B True
A True
B False
B A compiler error
ArithmeticException
This is the finally block
C
Array out of bounds!
Out of the block
ArithmeticException
D
Array out of bounds!
ArithmeticException
E
This is the finally block
B Checked exception
C Unchecked exception
The following code uses the Scanner class to read input from the user. What is the program's
output when the user types in the input "Java"?
A The program will ignore "Java" and prompt the user again.