Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » }; significance
}; significance [message #1725762] Mon, 07 March 2016 13:35 Go to next message
Hariharan Balakrishnan is currently offline Hariharan BalakrishnanFriend
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 #1725782 is a reply to message #1725762] Mon, 07 March 2016 15:18 Go to previous messageGo to next message
Hariharan Balakrishnan is currently offline Hariharan BalakrishnanFriend
Messages: 3
Registered: March 2016
Junior Member
No Message Body
Re: }; significance [message #1725794 is a reply to message #1725782] Mon, 07 March 2016 17:05 Go to previous message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4435
Registered: July 2009
Senior Member

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
Previous Topic:Eclipse mars 2 converts numbers into wierd chars
Next Topic:Creating simple bluetooth server
Goto Forum:
  


Current Time: Thu Apr 25 02:29:42 GMT 2024

Powered by FUDForum. Page generated in 0.08825 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top