broader vs wider range of subclass

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
hsiaok
Posts: 7
Joined: Tue Aug 22, 2017 11:13 am
Contact:

broader vs wider range of subclass

Post by hsiaok »

Does "broader" class means subclass or superclass of the class in question ?
Does "wider" means the opposite of broader ?

very confusing to me.
Please verify.
Thanks.

admin
Site Admin
Posts: 10388
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: broader vs wider range of subclass

Post by admin »

"broader" and "wider" both mean the same thing i.e. something that covers more. "narrow" is the opposite of "broader".

In general, a subclass is "narrower" than a superclass because it is more specific. For example, an IOException is narrower than Exception because an Exception will cover a lot more number of classes than an IOException. In other words, every IOException is an Exception but every Exception is not an IOException because there can be a class that is an Exception but not an IOException. Thus, Exception covers more exceptions than IOException.

When talking about range, broader or wider do not necessarily always mean subclass or super class. For example, if a method in super class throws an exception named A, the overriding method in a subclass cannot throw exceptions A and B because an overriding method cannot throw a wider range of exceptions than the overridden method.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests