Q. What is the purpose of the ‘assert’ keyword?

A
To handle exceptions
B
To test assumptions during development
C
To create a new thread
D
To define a method
Solution:

Assert is used to check conditions that should be true, throwing an AssertionError if false.

Entri Contact Image

Get Expert Advice for Free: Register for Your Free Consultation Now!