[Updated] Goldman Sachs Aptitude Test Questions and Answers
Practice List of TCS Digital Coding Questions !!!
Take 50+ FREE!! Online Data Interpretation Mock test to crack any Exams.

JAVA Programming :: Inheritance - Discussion

Home > JAVA Programming > Inheritance > MCQs Questions Discussion

10 / 9

What is the output for the below code?

interface A {
public void printValue();
}
public class Test{
public static void main (String[] args){
A a1 = new A() {
public void printValue(){
System.out.println("A");
 }
 };
 a1.printValue();
 }
 }

ACompilation fails due to an error on line 3

BA

CCompilation fails due to an error on line 8

Dnull

Answer: Option (Login/Signup)

Show Explanation

Asked In ::

Post Your Answer Here:     

No Discussion on this question yet!