}; significance [message #1725762] |
Mon, 07 March 2016 13:35 |
Hariharan Balakrishnan Messages: 3 Registered: March 2016 |
Junior Member |
|
|
Hi while implementing try catch block I observed this
try {
date = formatter.parse(str);
} catch (ParseException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
};
No error with };
whereas
try {
date = formatter.parse(str);
}; catch (ParseException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
};
It showed error
Can anyone explain this concept? ,What is the significance of semicolon after parenthesis
[Updated on: Mon, 07 March 2016 13:37] Report message to a moderator
|
|
|
|
Re: }; significance [message #1725794 is a reply to message #1725782] |
Mon, 07 March 2016 17:05 |
|
Those aren't parentheses, they're braces. The semicolon ends the statement, and 'try' must be paired with 'catch' or 'finally'. The first case is not an error, it just does nothing useful there.
_
Nitin Dahyabhai
Eclipse Web Tools Platform
|
|
|
Powered by
FUDForum. Page generated in 0.08825 seconds