26 ms·
English isn't my native language but I read that as "in case it throws this type of exception" so "case throws" makes perfect sense to me.
by grishka 3y ago
English isn't my native language but I read that as "in case it throws this type of exception" so "case throws" makes perfect sense to me.
- NoahKAndrews 3y agoBut the throws keyword means "this can throw", it's not used to actually handle exceptions at all. Exception handling always uses catch. I think breaking that pattern would be a terrible idea, even if you can make sense if it with English grammar
- grishka 3y agoMake it "case threw" then lol. But then this isn't the first time a keyword in Java means different things in different contexts. Like "final", which means that a field or variable can't be modified but on a class it means it can't be extended and on a method that it can't be overridden.