JAVA Interfaces and Abstract Classes Which of the following is a correct interface? abstract interface A { print(); } interface A { void print(); } abstract interface A { abstract void print(); { }} interface A { void print() { } } abstract interface A { print(); } interface A { void print(); } abstract interface A { abstract void print(); { }} interface A { void print() { } } ANSWER DOWNLOAD EXAMIANS APP
JAVA Interfaces and Abstract Classes What is the output for the below code ?interface A{ public void printValue();}1. public class Test{2. public static void main (String[] args){3. A a1 = new A(){4. public void printValue(){5. System.out.println("A");6. }7. };8. a1.printValue();9. }10. } Compilation fails due to an error on line 3 null Compilation fails due to an error on line 8 A None of these Compilation fails due to an error on line 3 null Compilation fails due to an error on line 8 A None of these ANSWER DOWNLOAD EXAMIANS APP
JAVA Interfaces and Abstract Classes What will be the output for the below code ?public interface TestInf{ int i =10;}public class Test{ public static void main(String... args){ TestInf.i=12; System.out.println(TestInf.i); }} 10 Runtime Exception 12 Compile with error None of these 10 Runtime Exception 12 Compile with error None of these ANSWER DOWNLOAD EXAMIANS APP
JAVA Interfaces and Abstract Classes Given the following piece of code:public class School{ public abstract double numberOfStudent();}which of the following statements is true? The method numberOfStudent() in class School must have a body. Class School must be defined abstract. You must add a return statement in method numberOfStudent(). The keywords public and abstract cannot be used together. The method numberOfStudent() in class School must have a body. Class School must be defined abstract. You must add a return statement in method numberOfStudent(). The keywords public and abstract cannot be used together. ANSWER DOWNLOAD EXAMIANS APP
JAVA Interfaces and Abstract Classes interface Test{ int p = 10; //line 1 public int q = 20; //line 2 public static int r = 30; //line 3 public static final int s = 40; //line 4}Which of the above line will give compilation error? 2 1 3 None of these 4 2 1 3 None of these 4 ANSWER DOWNLOAD EXAMIANS APP
JAVA Interfaces and Abstract Classes Which of the following declares an abstract method in an abstract Java class? public abstract void method() {} public abstract void method(); public void method() {} public void abstract Method(); public abstract method(); public abstract void method() {} public abstract void method(); public void method() {} public void abstract Method(); public abstract method(); ANSWER DOWNLOAD EXAMIANS APP