Table of Contents
Java Interface: Definition and Examples
🔒 Please log in to unlock this course.
ONLINE CLASSES BY RUMMAN ANSARI
Stuck on a Java Program? Ask Your Doubt Directly
Book a one-to-one session to get your questions answered, or message on WhatsApp for live online classes in Java Programming.
- 1:1 Mentoring
- Doubt Clearing
- Interview Preparation
MCQ Section
MCQ 1
What will be the output when the following program is compiled and executed? abstract class…
Locked. Enroll to open this MCQ.
MCQ 2
What is the output for the below code ? interface A{ public void printValue(); } 1. public class…
Locked. Enroll to open this MCQ.
MCQ 3
interface Test{ int p = 10; //line 1 public int q = 20; //line 2 public static int r = 30; //line 3…
Locked. Enroll to open this MCQ.
MCQ 4
What will be the output for the below code ? public interface TestInf{ int i =10; } public class…
Locked. Enroll to open this MCQ.
MCQ 5
interface Base{ boolean m1 (); byte m2(short s); } which two code fragments will compile? 1.…
Locked. Enroll to open this MCQ.
MCQ 6
What happens if the following program is compiled and executed? interface MyInterface{ void…
Locked. Enroll to open this MCQ.
MCQ 7
Which of the following declares an abstract method in an abstract Java class?
Locked. Enroll to open this MCQ.
MCQ 8
What will happen after compiling this program code? abstract class MyClass{ //line 1 private int a,…
Locked. Enroll to open this MCQ.
MCQ 9
Given the following piece of code: public interface Guard{ void doYourJob(); } abstract public…
Locked. Enroll to open this MCQ.
MCQ 10
What will be the output? 1. public interface InfA{ 2. protected String getName(); 3. } public class…
Locked. Enroll to open this MCQ.
MCQ 11
What will be the output? interface A{ public void method(); } class One{ public void method(){…
Locked. Enroll to open this MCQ.
MCQ 12
Runnable is a _____ .
Locked. Enroll to open this MCQ.
MCQ 13
Determine output of the following code. interface A { } class C { } class D extends C { } class B…
Locked. Enroll to open this MCQ.
MCQ 14
Given the following piece of code: public class School{ public abstract double numberOfStudent(); }…
Locked. Enroll to open this MCQ.
MCQ 15
Which two of the following are legal declarations for abstract classes and interfaces? 1. final…
Locked. Enroll to open this MCQ.
MCQ 16
Which of the following class definitions defines a legal abstract class?
Locked. Enroll to open this MCQ.
MCQ 17
Which of the following is a correct interface?
Locked. Enroll to open this MCQ.
MCQ 18
Which of the following statements regarding abstract classes are true?
Locked. Enroll to open this MCQ.
MCQ 19
Suppose A is an abstract class, B is a concrete subclass of A, and both A and B have a default…
Locked. Enroll to open this MCQ.
MCQ 20
In Java, declaring a class abstract is useful
Locked. Enroll to open this MCQ.
Get Java Programming Language updates by email
Short, practical lessons and course updates from Rumman Ansari. No spam.