OCP - Before Exam
...
...
Fichier Détails
Cartes-fiches | 83 |
---|---|
Langue | English |
Catégorie | Informatique |
Niveau | Autres |
Crée / Actualisé | 02.05.2019 / 03.05.2019 |
Attribution de licence | Non précisé |
Lien de web |
https://card2brain.ch/box/20190502_ocp_before_exam
|
Intégrer |
<iframe src="https://card2brain.ch/box/20190502_ocp_before_exam/embed" width="780" height="150" scrolling="no" frameborder="0"></iframe>
|
Does DateTimeFormatter throw a Checked Exception or an uncheced?
It throws a DateTimeException which is a RuntimeException
Is it dangerous to ommit the generic type when using Predicate or Function?
Yes:
- Compiler Warning
- Auto Boxing might not work as Expected, eg. boolean will neither be autoboxed into a Boolean nor Object!
Does forEach accept an implementation of Function?
No, only a Consumer implementation!
What happens when catching an checked exception that is not declared by any method in the try block?
The code will not compile!
Can you declare a Method as final?
Yes, instance methods, but not static methods!
Must a ENUM enumeration end with a Semicolon?
The semicolon is only required when methods/constructors are declared afterwards!
What is the difference between Optional.orElse(...) and Optional.orElseGet(...)?
- Optional.orElse(T) returns the provided value
- Optional.orElseGet(Supplier<? extends T>) uses the provided supplier to get the default value
Can a Properties Class be instantiated using a Constructor?
Yes