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

6/16

Page

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

Which of the following is not a segment of memory in java?

Select an option to see the answer and solution.

Which of these method of FileReader class is used to read characters from a file?

Select an option to see the answer and solution.

Which of these methods is not a Locale class?

Select an option to see the answer and solution.

Which of these methods is used to know whether a given Character object is part of Java's Identifiers?

Select an option to see the answer and solution.

Which of the following is method of wrapper Integer for converting the value of an object into int?

Select an option to see the answer and solution.

Will this Java program generate same output is executed again?
class Output 
{
    public static void main(String args[]) 
    {
        int y = double z = Math.random();
        System.out.print(y);
    }
}

Select an option to see the answer and solution.

Which of these keywords is used to define interfaces in Java?

Select an option to see the answer and solution.

Which of the following is an incorrect statement about packages?

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 false true";
        boolean x = Boolean.valueOf(str);
        System.out.print(x);
    }
}

Select an option to see the answer and solution.

Which of these class is used to read characters in a file?

Select an option to see the answer and solution.

What is JVM?

Select an option to see the answer and solution.

Which of these classes encapsulate runtime environment?

Select an option to see the answer and solution.

What will be the output of the following Java program?
class newthread implements Runnable 
{
Thread t;
    newthread() 
    {
        t = new Thread(this,"My Thread");
        t.start();
}
public void run() 
    {
  System.out.println(t);
}
}
class multithreaded_programing 
{
    public static void main(String args[]) 
    {
        new newthread();        
    }
}

Select an option to see the answer and solution.

What will be the output of the following Java program?
class newthread implements Runnable 
{
Thread t;
    newthread() 
    {
        t = new Thread(this,"My Thread");
        t.start();
}
}
class multithreaded_programing 
{
    public static void main(String args[]) 
    {
        new newthread();        
    }
}

Select an option to see the answer and solution.

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(b.equals(a));
    }
}

Select an option to see the answer and solution.

Which of these is a super class of wrappers Double & Integer?

Select an option to see the answer and solution.

Which one of the following is a class loader?

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[]) 
    {
        Integer i = new Integer(257);  
        byte x = i.byteValue();
        System.out.print(x);
    }
}

Select an option to see the answer and solution.

Which of these interfaces is implemented by TimerTask class?

Select an option to see the answer and solution.

Which of the following is an incorrect statement regarding the use of generics and parameterized types in Java?

Select an option to see the answer and solution.