Home » Java programming language

Java ClassLoader clearAssertionStatus() method with example

ClassLoader Class clearAssertionStatus() method: Here, we are going to learn about the clearAssertionStatus() method of ClassLoader Class with its syntax and example.
Submitted by Preeti Jain, on November 24, 2019

ClassLoader Class clearAssertionStatus() method

  • clearAssertionStatus() method is available in java.lang package.
  • clearAssertionStatus() method is used to clear the assertion status settings and sets the assertion status for this class loader to false by default.
  • clearAssertionStatus() method is a non-static method, it is accessible with the class object only and if we try to access the method with the class name then we will get an error.
  • clearAssertionStatus() method does not throw an exception at the time of clearing assertion status.


    public void clearAssertionStatus();


  • It does not accept any parameter.

Return value:

The return type of this method is void, it returns nothing.


// Java program to demonstrate the example 
// of void clearAssertionStatus() method of ClassLoader 

public class ClearAssertionStatusOfClassLoader {
 public static void main(String[] args) throws Exception {
  // Load a class
  Class cl = Class.forName("ClearAssertionStatusOfClassLoader");

  // It returns the ClassLoader associated with the
  // class Object
  ClassLoader loader = cl.getClassLoader();

  // Display loader
  System.out.println("loader Class: " + loader.getClass());

  // By using clearAssertionStatus() method is to clear the
  // previous status and sets the default status to false


loader Class: class jdk.internal.loader.ClassLoaders$AppClassLoader


Comments and Discussions



Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© some rights reserved.