Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

illegal start of expression ??

 
Sonu Shawnee
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What wring with this code,
thats making it cough these errors ??[ edited to preserve formatting using the [code] and [/code] UBB tags -ds ]
[ July 30, 2002: Message edited by: Dirk Schreckmann ]
 
nupur dhawan
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this, hope it helps !
please let me know if that helped .
[ edited to preserve formatting using the [code] and [/code] UBB tags -ds ]
[ July 30, 2002: Message edited by: Dirk Schreckmann ]
 
Sonu Shawnee
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That helped a bit I guess as now its just one error instead of two.Thanks.
[ edited to preserve formatting using the [code] and [/code] UBB tags -ds ]
[ July 30, 2002: Message edited by: Dirk Schreckmann ]
 
nupur dhawan
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Sonu Shawnee:
That helped a bit I guess as now its just one error instead of two.
RANData.java:117: illegal start of expression
for(int i = 0; i < NUMBER_OF_QUESTIONS; i++)
^
1 error
Thanks.

Well , Sonu , the reason for that is that you cannot have a for loop as one of the operands of a && operator ....which is what you have done in your case .The logicals operator can be used to test if either of the operands are true or false , that is to test boolean conditions .
the operands can be expressions which evaluate to true or false , but cannot be a for loop !!
 
Sonu Shawnee
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
got it !!
Yeah, I realized that and so I put the code this way !!
That solved the problem !!
Thanks a bunch !!
[ edited to preserve formatting using the [code] and [/code] UBB tags -ds ]
[ July 30, 2002: Message edited by: Dirk Schreckmann ]
 
nupur dhawan
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Sonu , that looks much better . I'm glad i could be of help .
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could also replace

by

which is the short form of
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic