Page 1 of 1

About Question enthuware.ocpjp.ii.v11.2.1322 :

Posted: Tue Jan 05, 2021 8:37 pm
by philippe
Regarding the following option:
Assertions require changes at the API level.
What exactly is meant with the explanation:
Besides the 'assert' keyword, new methods are added in java.lang.Class and java.lang.ClassLoader classes.
I don't understand the link between the 'assert' keyword and new methods that are added in java.lang.Class and java.lang.ClassLoader.

Re: About Question enthuware.ocpjp.ii.v11.2.1322 :

Posted: Tue Jan 05, 2021 9:33 pm
by admin
The assert facility built on top of the existing functionality provided by the JVM. The JVM is not affected (and is even unaware that something like assertions exist). Class and ClassLoader classes are a part of the Java Application Programming Interface (API) and changes were made to these classes to support assertions.
You may go through this for more details: https://docs.oracle.com/javase/7/docs/t ... ssert.html