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

5/16

Page

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

Which of these class is used to read and write bytes in a file?

Select an option to see the answer and solution.

Which of these method returns the remainder of dividend / divisor?

Select an option to see the answer and solution.

Which of the following is the correct way of implementing an interface salary by class manager?

Select an option to see the answer and solution.

Which of these is a mechanism for naming and visibility control of a class and its content?

Select an option to see the answer and solution.

Which of these methods returns the class of an object?

Select an option to see the answer and solution.

What will be the output of the following Java program?
import java.lang.System;
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, 0, b, 3, a.length - 3);
        System.out.print(new String(a) + " " + new String(b));
    }
}

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[]) 
    {
        double x = 3.14;  
        int y = (int) Math.toRadians(x);
        System.out.print(y);
    }
}

Select an option to see the answer and solution.

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

Select an option to see the answer and solution.

Which of these class defines how the classes are loaded?

Select an option to see the answer and solution.

Which of these class is a superclass of all other classes?

Select an option to see the answer and solution.

What will be the output of the following Java program?
import java.util.*;
class LOCALE_CLASS
{
    public static void main(String args[])
    {
        Locale obj = new Locale("HINDI") ;
        System.out.print(obj.getDisplayLanguage());
    }
}

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 = '@';
        boolean x = Character.isLetter(a);
        System.out.print(x);
    }
}

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[]) 
     {
         double x = 3.14;  
         int y = (int) Math.floor(x);
         System.out.print(y);
     }
}

Select an option to see the answer and solution.

What will be the output of the following Java program?
import java.util.*;
class LOCALE_CLASS
{
    public static void main(String args[])
    {
        Locale obj = new Locale("HINDI", "INDIA") ;
        System.out.print(obj.getDisplayLanguage());
    }
}

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[]) 
    {
        long start, end;   
        start = System.currentTimeMillis();
        for (int i = 0; i < 10000000; i++);
        end = System.currentTimeMillis();
        System.out.print(end - start);
    }
}

Select an option to see the answer and solution.

All methods must be implemented of an interface.

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[])
    {
        Double i = new Double(257.5);  
        Double x = i.MAX_VALUE;
        System.out.print(x);
    }
}

Select an option to see the answer and solution.

Which of these exceptions is thrown by methods of System class?

Select an option to see the answer and solution.

Which of these class encapsulate the runtime state of an object or an interface?

Select an option to see the answer and solution.

Which of these methods is used to notify observer the change in observed object?

Select an option to see the answer and solution.