Determine output of the following code.
interface A { } class C { } class D extends C { } class B extends D implements A { } public class Test extends Thread{ 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"); } }
A.Nothing.
B.b is an instance of A.
C.b is an instance of C.
D.b is an instance of A followed by b is an instance of C.
Answers
Answered by
1
hey mate........the answer is
D.b is an instance of A followed by b is an instance of C.
D.b is an instance of A followed by b is an instance of C.
Answered by
0
(^_-)(^_-)(^_-)(^_-)(^_-)(^_-)(^_-)(^_-)(^_-)
╭╼╾╼╾╼╾╼╾╼╾╼╾╼╾╮
┃ ┈┈ [_Hɪ Mᴀᴛᴇ_] ┈┈┈ ┃
╰╼╾╼╾╼╾╼╾╼╾╼╾╼╾╯
╔═══❁═❀═✪═❀═❁════╗
......Here You Go Ur Answer......
╚═══❁═❀═✪═❀═❁════╝
ıllıllıllıllıllıllı[ Your Answer ]ıllıllıllıllıllıllı
◆━━━━━◆♤◆━━━━━◆
☆Correct | ♤ | Option☆
◆━━━━━◆♤◆━━━━━◆
▂▃▅▇█▓▒░[ Hope It Helps You Dear ]░▒▓█▇▅▃▂
╭╼╾╼╾╼╾╼╾╼╾╼╾╼╾╮
┃ ┈┈ [_Hɪ Mᴀᴛᴇ_] ┈┈┈ ┃
╰╼╾╼╾╼╾╼╾╼╾╼╾╼╾╯
╔═══❁═❀═✪═❀═❁════╗
......Here You Go Ur Answer......
╚═══❁═❀═✪═❀═❁════╝
ıllıllıllıllıllıllı[ Your Answer ]ıllıllıllıllıllıllı
◆━━━━━◆♤◆━━━━━◆
☆Correct | ♤ | Option☆
◆━━━━━◆♤◆━━━━━◆
▂▃▅▇█▓▒░[ Hope It Helps You Dear ]░▒▓█▇▅▃▂
Similar questions
Math,
6 months ago
Social Sciences,
6 months ago
Social Sciences,
6 months ago
Computer Science,
1 year ago
Computer Science,
1 year ago
Math,
1 year ago
English,
1 year ago