Online Java Compiler By
JavaTpoint.com
import java.lang.*; class Example1 { public Example1(){ System.out.println(" Base class Costructor"); } } public class ClassasdesiredAssertionStatusExample2 extends Example1 { public static void main(String[] args) { ClassasdesiredAssertionStatusExample1 obj = new ClassasdesiredAssertionStatusExample1(); Example1 obj2 = new Example1(); Class cls1 = obj.getClass(); String nm = cls1.getName(); //get the name of class System.out.println("Class Name = " + nm); boolean val = cls1.desiredAssertionStatus(); System.out.println("status = " + val); } }
Output