1.

Is The Following Program Written Correctly? If Yes, What Will Be The Output? Interface Abc { Void Methodone(); } Interface Pqr Extends Abc { Void Methodtwo(); } Abstract Class Xyz Implements Pqr { Public Void Methodone() { Methodtwo(); } } Class Mno Extends Xyz { Public Void Methodtwo() { Methodone(); } } Public Class Mainclass { Public Static Void Main(string[] Args) { Abc Abc = New Mno(); Abc.methodone(); } }

Answer»

Yes, program is WRITTEN is correctly. But, it will throw StackOverflowError at RUN time. Because, METHODONE() and methodTwo() are cyclicly CALLED.

Yes, program is written is correctly. But, it will throw StackOverflowError at run time. Because, methodOne() and methodTwo() are cyclicly called.



Discussion

No Comment Found

Related InterviewSolutions