Java Class desiredAssertionStatus() Method

The desiredAssertionStatus() method of java Class class returns the assertion status that would be assigned to this (current class object) class, if it is to be initialized at the time desiredAssertionStatus() method is invoked. If the assertion status is already set, the most recent setting will be returned.

Syntax

Parameter

No parameter is passed.

Returns

desired assertion status of the specified class.

Throws

Does not throw any Exception.

Example 1

Test it Now

Output:

Class Name = ClassasdesiredAssertionStatusExample1
status = false

Example 2

Test it Now

Output:

Base class Costructor
Class Name = ClassasdesiredAssertionStatusExample1
status = false

Next TopicJava Class




Latest Courses