Premium Partner

OCP - Before Exam

...

...


Kartei Details

Karten 83
Sprache English
Kategorie Informatik
Stufe Andere
Erstellt / Aktualisiert 02.05.2019 / 03.05.2019
Lizenzierung Keine Angabe
Weblink
https://card2brain.ch/box/20190502_ocp_before_exam
Einbinden
<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:

  1. Compiler Warning
  2. 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