Shortcut Navigation:

XA0 XA0 XA0 Quiz

This section of our 1000+ Java MCQs focuses core Java API packages in Java Programming Language.

Which of these package is used for analyzing code during run-time?

Which of these package is used for handling security related issues in a program?

Which of these class allows us to get real time data about private and protected member of a class?

Which of these package is used for invoking a method remotely?

Which of these package is used for all the text related modifications?

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

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

What is the length of the application box made by this program?
import java.awt.*;
    import java.applet.*;
    public class myapplet extends Applet {
        Graphic g;
        g.drawString("A Simple Applet",20,20);    
    }

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