Vidyalelo
Java Programming · all questions

Interfaces and Abstract Classes
practice.

Practice every MCQ with options. Use Show answers when you want the correct option and solution.

309

Questions

12/16

Page

Pick an option on a question to see the right answer and solution.

Which of these class holds a collection of static methods and variables?

Select an option to see the answer and solution.

What will be the output of the following Java code?
class Output 
{
    public static void main(String args[]) 
    {
        byte a[] = { 65, 66, 67, 68, 69, 70 };
        byte b[] = { 71, 72, 73, 74, 75, 76 };  
        System.arraycopy(a, 1, b, 3, 0);
        System.out.print(new String(a) + " " + new String(b));
    }
}

Select an option to see the answer and solution.

Which of these class can generate pseudorandom numbers?

Select an option to see the answer and solution.

Which of these method returns a largest whole number less than or equal to variable X?

Select an option to see the answer and solution.

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

Select an option to see the answer and solution.

Which of these method of Object class can generate duplicate copy of the object on which it is called?

Select an option to see the answer and solution.

Which of these packages contain classes and interfaces used for input & output operations of a program?

Select an option to see the answer and solution.

Which of this interface is implemented by Thread class?

Select an option to see the answer and solution.

Which of these methods return a smallest whole number greater than or equal to variable X?

Select an option to see the answer and solution.

Which of these class is not a member class of java.io package?

Select an option to see the answer and solution.

Random is a final class?

Select an option to see the answer and solution.

Which of these method converts radians to degrees?

Select an option to see the answer and solution.

What will be the output of the following Java program?
class Output
{
    public static void main(String args[])
    {
  char a = (char) 98;
        a = Character.toUpperCase(a);
        System.out.print(a);
    }
}

Select an option to see the answer and solution.

Which of these type parameters is used for a generic class to return and accept a number?

Select an option to see the answer and solution.

Which of the following package stores all the simple data types in java?

Select an option to see the answer and solution.

Which of the following methods is a method of wrapper Integer for obtaining hash code for the invoking object?

Select an option to see the answer and solution.

Which of these method return a pseudorandom number?

Select an option to see the answer and solution.

Which of these class have only one field?

Select an option to see the answer and solution.

What will be the output of the following Java program?
class Output
{
    public static void main(String args[])
    {
        String str = "TRUE";
        boolean x = Boolean.valueOf(str);
        System.out.print(x);
    }
}

Select an option to see the answer and solution.

Which of these methods is used to obtain value of invoking object as a long?

Select an option to see the answer and solution.