Very often, for these β-ableβ names, they are interfaces in Java, but there is no formal interface naming convention that I have found, which suggests that β-ableβ names should be interface names, although this is usually the case.
The official Java naming conventions can be found here - this is pretty meager, in fact there are no restrictions for naming classes or interfaces:
Regarding your Throwable question, James Gosling once answered why this is a class and not an interface, although the name was more appropriate for the interface.
Unfortunately, the original article from the Sun / Oracle website disappeared on the Internet, so I can only indicate indirect attribution:
edit: As I continue to receive answers to this question, I found a link to the Sun discussion through the Wayback Machine , here: http://web.archive.org/web/20071013225816/http://java.sun.com/features/2002 /03/gosling.html?source=jdc_news&date=20020430
JDC: Why is Throwable not an interface? The type name suggests what it should have been. The ability to catch types, that is, something like try {} catch (), and not just classes. This would make the Java programming language more flexible.
JG: The reason Throwable and the rest of these guys are not interfaces is because we decided, or I decided quite early. I decided that I want to have some kind of state associated with every exception that is thrown. And you cannot do this with interfaces; you can only do this with classes. A condition that is mostly standard. There is a message, there is a snapshot, all that is always there. and also, if you make a Throwable interface, it is tempting to assign any old object to be a Throwable thing. Stewartingly, throwing shared objects is probably a bad idea that the things you want to throw should really be things that are called to be exceptions that really capture the nature of the exception and what happens. These are not just general data structures.
birryree
source share