OOP mentore week 9

Welcome!
1 / 16
suivant
Slide 1: Diapositive
NatuurkundeMiddelbare school

Cette leçon contient 16 diapositives, avec quiz interactifs et diapositive de texte.

Éléments de cette leçon

Welcome!

Slide 1 - Diapositive

Static binding happens at runtime
A
True
B
False

Slide 2 - Quiz

Java allows multiple inherintance
A
True
B
False

Slide 3 - Quiz

Using Optional<> avoid all NullPointerExceptions
A
True
B
False

Slide 4 - Quiz

You can add a char to a ArrayList<Characters>
(without getting exceptions)
A
True
B
False

Slide 5 - Quiz

Writing good tests guarantees a program will not crash
A
True
B
False

Slide 6 - Quiz

Which interpretation of the keyword abstract is false?
A
Making a class abstract means that all of its methods should be abstract
B
Making a class abstract means that it cannot be instantiated
C
A concrete subclass must implement abstract methods in its parent

Slide 7 - Quiz

Which is not a valid way to start a new thread?
A
Extend the class Thread and call .start() on an instance of this class
B
Create a Thread with a lambda as argument and call .start()
C
Implement the interface Runnable and call .run()

Slide 8 - Quiz

Which of the following cannot be caught in a catch block?
A
StackOverflowError
B
IOException
C
ArrayIndexOutOf BoundsException

Slide 9 - Quiz

When attempting to cast between incompatible types...
A
The program will not compile
B
The program will raise an exception on runtime
C
The incompatible fields will be filled with null

Slide 10 - Quiz

Which statement about BufferedReader and Scanner is false?
A
Scanner can be used to read from an InputStream
B
A BufferedReader is a reader that takes a reader as an argument
C
BufferedReader can only read a single character at a time

Slide 11 - Quiz

Which is true?
A
This method does not compile
B
This method will raise an ArrayIndexOutOf BoundsExcpetion
C
This method will raise a NullPointException
D
This method will work without problema

Slide 12 - Quiz


A
CoffeeMachine extends Machine and Grinder extends CoffeeMachine
B
CoffeeMachine extends Machine and CoffeeMachine implements Ginder as interface
C
CoffeMachine extends Machine and Grinder is attribute of CoffeMachine by use of composition
D
CoffeeMachine extends Machine but not relation between CoffeeMachine and Grinder (they don't share properties)

Slide 13 - Quiz

Which is
true?
A
The test does not compile
B
The test passes
C
The test fails
D
The test leads to a runtime exception

Slide 14 - Quiz

What is
the outcome?
A
The program does not compile
B
18
C
36
D
54

Slide 15 - Quiz

Which
is true?
A
The program does not compile
B
A runtime exception occurs
C
"A pair of animals" is printed
D
"A pair of coatis" is printed

Slide 16 - Quiz