logo

Crowdly

Browser

Add to Chrome

Що буде результатом компіляції і запуску наступного коду? public class Quest ...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

Що

буде результатом компіляції і запуску наступного коду?

public class

Quest {

public static

void main (String [] args) {

MedicalStaff

medic = new HeadDoctor ();

if (medic

instanceof Nurse) {

System.out.

println

( "Nurse");

}

else if (medic instanceof Doctor) {

System.out.println

( "Doctor");

}

else if (medic instanceof HeadDoctor) {

System.out.println

( "HeadDoctor");

}

}

}

class

MedicalStaff {}

class

Doctor extends MedicalStaff {}

class

Nurse extends MedicalStaff {}

class

HeadDoctor extends Doctor {}

❌
✅
❌
❌
More questions like this

Want instant access to all verified answers on iekportal.com.ua?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome