Given this program:
import java.time.*; import java.time.temporal.ChronoUnit; class Main {// ww w . j a va 2s. com public static void main(String []args) { Duration tenYears = ChronoUnit.YEARS.getDuration().multipliedBy(10); Duration aDecade = ChronoUnit.DECADES.getDuration(); assert tenYears.equals(aDecade) : "10 years is not a decade!"; } }
Assume that this program is invoked as follows:
java Main
Choose the correct option based on this program:
d)
the program compiles cleanly without any errors.
assertions are disabled by default.
Since assertions are not enabled when invoking this program, it does not evaluate the assert expression.
hence, the program terminates normally without printing any output on the console.