Question: What does the following print? A. false, false, false B. false, false, true C. false, true, true D. true, false, true E. true, true, false

What does the following print? 

interface Vehicle {} class Bus implements Vehicle {} public class Transport {

A. false, false, false

B. false, false, true

C. false, true, true

D. true, false, true

E. true, true, false

F. true, true, true

interface Vehicle {} class Bus implements Vehicle {} public class Transport { public static void main(String[] args) { Bus bus new Bus(); } } boolean n null instanceof Bus; boolean v bus instanceof Vehicle; boolean b = bus instanceof Bus; System.out.println(n + " " + v + " " + b);

Step by Step Solution

3.47 Rating (150 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The code snippet provided is written in Java and is meant to test the use of the instanceof operator ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Oracle Questions!