Computer Science, asked by anutwins2626, 10 months ago

What will be the output of the following code snippet?
public class A extends B{
public static void main(String[] args) {
A a = new A();
}
}
class B extends A{
}
Select
The code will compile but will give exception to "cyclic inheritance involving A" at runtime
The code will give error to "cyclic inheritance involving A" at compile time

The code will compile and run without a problem

The code will give an ExceptioninInitializerError at runtime

Answers

Answered by anuham97
2

Answer:

The code will give error to "cyclic inheritance involving A" at compile time

Similar questions