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.
broader vs wider range of subclass
Moderator: admin
-
- Posts: 7
- Joined: Tue Aug 22, 2017 11:13 am
- Contact:
-
- Site Admin
- Posts: 10388
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: broader vs wider range of subclass
"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.
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.
Who is online
Users browsing this forum: No registered users and 3 guests