MCQOPTIONS
Saved Bookmarks
| 1. |
What is the output of this program?import java.lang.reflect.*; public class Additional_packages_Example { public static void main(String args[]) { try { Class object = Class.forName("java.awt.Dimension"); Constructor constructors[] = object.getConstructors(); for (int k = 0; k < constructors.length; k++) System.out.println(constructors[k]); } catch (Exception e) { System.out.print("Exception"); } } } |
| A. | Program prints all the possible constructors of class Class |
| B. | Program prints Exception |
| C. | Program prints all the constructors of java.awt.Dimension package |
| D. | Runtime Error |
| E. | Compilation Error |
| Answer» D. Runtime Error | |