Logo

Java Questions Set 43:

Quiz Mode

Which of these is a superclass of the Character wrapper class?

1
2
3
4

Solution:

Which of the following Java packages contains the Random class?

1
2
3
4

Solution:

Which of these variables is a static variable defined in Collections?

1
2
3
4

Solution:

Which of these methods of a Thread class is used to suspend a thread for a period of time?

1
2
3
4

Solution:

Which data member of the HttpResponse class is used to store the response status code from an HTTP server?

1
2
3
4

Solution:

Which of the following is the correct way to implement the 'salary' interface in a 'manager' class?

1
2
3
4

Solution:

What is the output of the following Java code?

public class Abekus {

public static void main(String[] args) {

for (int k = 0; k < 5; k++) {

int n = 25;

}

}

}

1
2
3
4

Solution:

class human 

    {

        int i;

        double j;

    }

    class child extends human 

    {

int k;

    }

    class output 

    {

        public static void main(String args[]) 

        {

            human i = new human();

            child j = new child();

            Class ref;

            ref = j.getClass();

            System.out.print(ref.isInstance(i));

        }

    }

1
2
3
4
5

Solution:

class first implements Runnable

{

public static void main(String foo[])

{

/*Missing code*/

}

public void run(){}

}


1
2
3
4
5
6
7
8

Solution:

Statement 1- IOException is thrown by loadClass() method of ClassLoader class 

Statement 1- ClassFormatError  is thrown by loadClass() method of ClassLoader class 

Statement 1- ClassNotFoundException is thrown by loadClass() method of ClassLoader class 

Statement 1- SystemException is thrown by loadClass() method of ClassLoader class 



1
2
3
4
5

Solution: