1.

What is the output of this program?
import java.lang.reflect.*;
public class Additional_package_Example
{
public static void main(String args[])
{
try
{
Class obj = Class.forName("java.awt.Dimension");
Method methods[] = obj.getMethods();
for (int k = 0; k < methods.length; k++)
System.out.println(methods[k]);
}
catch (Exception e)
{
System.out.print("Exception");
}
}
}

A. Exception
B. Program prints all the constructors of java.awt.Dimension package.
C. program prints all the methods and data member of java.awt.Dimension package.
D. Program prints all the data members of java.awt.Dimension package.
E. Program prints all the methods of java.awt.Dimension package.
Answer» F.


Discussion

No Comment Found

Related MCQs