TOTAL QS = 20Time [ 00 : 00 : 00 ]
00:00:00

Java Abstract Class Basics Online Practice Test 1

Instructions

Total Questions: 20

Total Minutes: 20

This ExamTray Free Online Test or Quiz or Trivia tests your Programming Skills on the basics of Java Abstract Class. This test displays answers after finishing the exam for review. You can easily clear Competitive Exams and Job Interview Questions. Students can learn Java basics.

Go through Java Theory Notes on Abstract Class before attempting this test.

All the Best

Challenge SCORE

0 / 20

Take This Exam
1) An abstract class in Java can be created using the keyword ____.
2) To create an Abstract class, the keyword "class" is also required. State TRUE or FALSE.
3) Can you create an object from an abstract class in Java?
4) Which is the opposite of an Abstract Class?
5) Choose a correct implementation of an Abstract class in the below Java code?
6) An abstract class in Java usually contains one or more abstract ____.
7) Does the below Java code with abstract method compile?
class Puppy
{
  abstract void showName();
}
8) What is the output of the below Java program with an abstract class?
abstract class Coffee
{
  Coffee()
  {
    System.out.println("Inside Constructor of Coffee..");
  }
}
class ColdCoffee extends Coffee
{
  ColdCoffee()
  {
    System.out.println("Inside Constructor of ColdCoffee..");
  }
}
public class AbstractClassTesting
{
  public static void main(String[] args)
  {
    ColdCoffee cf = new ColdCoffee();
  }
}
9) What is the output of the below Java program with an abstract class?
final abstract class Bell
{  }
class DoorBell extends Bell
{
  DoorBell()
  {
    System.out.println("DoorBell ringing..");
  }
}
public class AbstractClassTesting2
{
  public static void main(String[] args)
  {
    Bell bell = new DoorBell();
  }
}
10) What is the output of the below Java program with an abstract class?
abstract class MathLibrary
{
  static final float PI = 3.1415f;
}

public class AbstractClassTesting3
{
  public static void main(String[] args)
  {
    System.out.println(MathLibrary.PI);
  }
}
11) What is the output of the below Java program with multiple abstract classes?
abstract class Editor
{
  abstract void show();
}

abstract class Author extends Editor
{
  abstract void print();
}

class Office extends Author
{
  void show()
  {
    System.out.println("Editor method");
  }
  void print()
  {
    System.out.println("Author method");
  }
}

public class AbstractClassTesting4
{
  public static void main(String[] args)
  {
    Editor ed = new Office();
    ed.show();

    Author au = new Office();
    au.print();	
  }
}
12) An object of multi-level inherited abstract class can not be created in memory? State TRUE or FALSE.
13) An abstract class with 100% abstract methods is equivalent to ______.
14) What is the output of the below Java program with an abstract class?
public abstract class AbstractClassTest5
{
  public static void main(String[] args)
  {
    System.out.println("Inside Main() method..");
  }
}
15) What is the output of the below Java code with an abstract class and inner class?
public abstract class AbstractClassTest6
{
  class Anonymous
  {
    int a=5;
  }
  public static void main(String args[])
  {
    System.out.print("Inner class is present..");	
  }	
}
16) Choose a correct statement about abstract classes?
17) Choose correct statements about an Abstract class in Java?
18) Just like an Interface, you can define constants in abstract classes in Java. State TRUE or FALSE.
19) Abstract classes support ____ inheritance.
20) An abstract class can define ____ inside of it.

 

 

Show some care. Like or Subscribe.

C MCQ App by ExamTray (Give us 5*)

EXAMTRAY C MCQ android app link

Java MCQ App by ExamTray (Give us 5*)

EXAMTRAY Java MCQ android app link
ALL MCQ App by ExamTray (Give us 5*) EXAMTRAY android app link
WUnsaved Whatsapp msg to Unknown(Give us 5*) WUnsaved android app link
Virtual Tape GPS (Give us 5*) Virtual Tape GPS android app link