Quick, Petty Java Question: Parenthesis around SQLException
-
03-07-2019 - |
Question
try {
...
} catch (SQLException sqle) {
String theError = (sqle).getSQLState();
...
}
What does surrounding sqle
with parenthesis do? Anything?
Just curious.
Solution
Quick reply - Nothing.
Longer reply - It might be a vestigial remnant of an inline cast:
((SomeMoreSpecificException)sqle).get...
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow