Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Else Error (Total newcomer)(Syntax error when trying to use else )
Else Error (Total newcomer) [message #1001149] Wed, 16 January 2013 06:17 Go to next message
Sean Wirth is currently offline Sean WirthFriend
Messages: 1
Registered: January 2013
Junior Member
Hi friends,

I just started taking a intro to java programming course for my major programming requirement and I'm having trouble using "else" when I'm trying to make if statements.

Every time I type in "else" it gives me the error "Syntax error on token, "else," Delete this token"

I've been watching videos and I'm really trying to get a leg up on the class and really get an understanding of java and eclipse because I've always liked the idea of being able to program using java.

Any help would be greatly appreciated!
Re: Else Error (Total newcomer) [message #1001355 is a reply to message #1001149] Wed, 16 January 2013 14:48 Go to previous messageGo to next message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3798
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

On 1/16/2013 6:31 AM, Sean Wirth wrote:
> Hi friends,
> I just started taking a intro to java programming course for my major
> programming requirement and I'm having trouble using "else" when I'm
> trying to make if statements.
>
> Every time I type in "else" it gives me the error "Syntax error on
> token, "else," Delete this token"
>
> I've been watching videos and I'm really trying to get a leg up on the
> class and really get an understanding of java and eclipse because I've
> always liked the idea of being able to program using java.
>
> Any help would be greatly appreciated!

First, this is a Java not an Eclipse question. Java questions are better
referred to forums for that purpose, some include javaranch.com,
jguru.com and stackoverflow.com.

Second, it's pretty hard to play compiler for you when you don't submit
any code to look at.
Re: Else Error (Total newcomer) [message #1003613 is a reply to message #1001355] Mon, 21 January 2013 16:03 Go to previous messageGo to next message
David Kerber is currently offline David KerberFriend
Messages: 100
Registered: July 2009
Senior Member
In article <kd6eno$kvs$2@xxxxxxxxe.org>, russ@xxxxxxxx
says...
>
> On 1/16/2013 6:31 AM, Sean Wirth wrote:
> > Hi friends,
> > I just started taking a intro to java programming course for my major
> > programming requirement and I'm having trouble using "else" when I'm
> > trying to make if statements.
> >
> > Every time I type in "else" it gives me the error "Syntax error on
> > token, "else," Delete this token"
> >
> > I've been watching videos and I'm really trying to get a leg up on the
> > class and really get an understanding of java and eclipse because I've
> > always liked the idea of being able to program using java.
> >
> > Any help would be greatly appreciated!
>
> First, this is a Java not an Eclipse question. Java questions are better
> referred to forums for that purpose, some include javaranch.com,
> jguru.com and stackoverflow.com.
>
> Second, it's pretty hard to play compiler for you when you don't submit
> any code to look at.

All that said, you're probably missing some curly braces.
Re: Else Error (Total newcomer) [message #1710748 is a reply to message #1001149] Thu, 08 October 2015 19:54 Go to previous message
dimple moudgil is currently offline dimple moudgilFriend
Messages: 1
Registered: October 2015
Junior Member
if (age>100);

That semicolon terminates the if statement, so the else doesn't go with anything. Remove the semicolon.
Previous Topic:Eclipse 4.5.1 Update Site?
Next Topic:Migrate toolbar trim contribution from rcp3.x to 4.x
Goto Forum:
  


Current Time: Fri Apr 26 04:06:30 GMT 2024

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

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

Back to the top