Online Java Compiler By
JavaTpoint.com
//import statements. import java.lang.*; import java.security.ProtectionDomain; public class ClassgetProtectionDomainExample1 { public static void main(String[] args) { try { Class class1 = Class.forName("ClassgetProtectionDomainExample1"); System.out.println("Class = " + class1.getName()); ProtectionDomain pdnm = class1.getProtectionDomain(); System.out.println(pdnm); } catch(ClassNotFoundException ex) { System.out.println(ex.toString()); //print exception object } } }
Output