Top Posters
Since Sunday
6
w
4
c
4
r
4
m
3
m
3
u
3
m
3
e
3
k
3
N
3
y
3
New Topic  
barry1999 barry1999
wrote...
Posts: 476
4 years ago
Show the output of running the class Test in the following code lines:

interface A {
}

class C {
}

class B extends D implements A {
}

public class Test {
public static void main(String[] args) {
B b = new B();
if (b instanceof A)
System.out.println("b is an instance of A");
if (b instanceof C)
System.out.println("b is an instance of C");
}
}

class D extends C {
}


▸ b is an instance of C.

▸ b is an instance of A followed by b is an instance of C.

▸ Nothing.

▸ b is an instance of A.
Textbook 
Introduction to Java Programming, Comprehensive Version

Introduction to Java Programming, Comprehensive Version


Edition: 10th
Author:
Read 63 times
1 Reply
Replies
Answer verified by a subject expert
n00835996n00835996
wrote...
Posts: 345
4 years ago
Sign in or Sign up in seconds to unlock everything for free
More solutions for this book are available here
1

Related Topics

barry1999 Author
wrote...

4 years ago
This site is awesome
wrote...

Yesterday
Thanks for your help!!
Mcb
wrote...

2 hours ago
Correct Slight Smile TY
New Topic      
Explore
Post your homework questions and get free online help from our incredible volunteers
  474 People Browsing
Related Images
  
 1034
  
 941
  
 302
Your Opinion
Which industry do you think artificial intelligence (AI) will impact the most?
Votes: 486