Email address:
Password:
SCJP/OCPJP 1.6 certification
Practice Exams and Training
SCJP Online Training » Discussions

About class c extending A.B

I tried compiling it and I get compilation error.

I don't see anything in this program that could generate a compile error.


What did the error say?

Hello!

May be it is question 50 of Practice Exam 1


interface I {}

class A extends B implements I{}

class B {}


I[] as = new A[]{new B()}; //Compilation Fail

B[] as = new A[]{new B()}; //fail too and answer E wrong

A[] as = new A[]{new B()}; //it's ok, answer C


but


interface I {}

class B {}

class A extends B implements I{}


I[] as = new A[]{new B()}; //fail

B[] as = new A[]{new B()}; //fail

A[] as = new A[]{new B()}; //fail


What is the answer correct?

Anatole,


Can you please start a new thread for your question? It would then be easier for me to follow and refer the question.


ExamLab © 2008 - 2024