Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Syntax error on token "else", delete this token

843785Jul 15 2008 — edited Jul 15 2008
I am getting the following error:
syntax error on token "else", delete this token

on the following code:
		if (releaseLevel.equals("Released")){
			String dcn = (String)JOptionPane.showInputDialog(null,
					"What is the DCN, DCR or NMDD #",
					"Identifier",
					JOptionPane.QUESTION_MESSAGE,
					null,
					null,
					"");
			else dcn = null;
		}//end of if
How do I get rid of this problem? It is doing it when I try to use if/else statements in my code. This is just one example, the other place can not be fixed by simply declaring the string to be null before the if.

Thank you,
Brian
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 12 2008
Added on Jul 15 2008
4 comments
1,006 views