569). Which of these methods return a class object given its name?

[A]getClass()
[B]findClass()
[C]getSystemClass()
[D] findSystemClass()

Show Answer

571). What will be the output of the following Java program?
    class X 
    {
        int a;
        double b;
    }
    class Y extends X 
    {
	int c;
    }
    class Output 
    {
        public static void main(String args[]) 
        {
            X a = new X();
            Y b = new Y();
            Class obj;
            obj = a.getClass();
            System.out.print(obj.getName());
        }
    }

[A]X
[B]Y
[C]a
[D]b

Show Answer

572). What will be the output of the following Java program?
    class X
    {
        int a;
        double b;
    }
    class Y extends X 
    {
	int c;
    }
    class Output 
    {
        public static void main(String args[]) 
        {
            X a = new X();
            Y b = new Y();
            Class obj;
            obj = b.getClass();
            System.out.print(obj.getSuperclass());
        }
    }

[A]X
[B]Y
[C] class X
[D] class Y

Show Answer

573). What will be the output of the following Java program?
    class X 
    {
        int a;
        double b;
    }
    class Y extends X 
    {
	int c;
    }
    class Output 
    {
        public static void main(String args[]) 
        {
            X a = new X();
            Y b = new Y();
            Class obj;
            obj = b.getClass();
            System.out.print(obj.isLocalClass());
        }
    }

[A]0
[B]1
[C]true
[D]false

Show Answer