Results 1 to 12 of 12
Like Tree1Likes
  • 1 Post By masijade

Thread: For Loop illegal start of expression error

  1. #1
    Syed Rizvi is offline Member
    Join Date
    Jul 2013
    Posts
    8
    Rep Power
    0

    Exclamation For Loop illegal start of expression error

    Hello Guys,
    Need your help i am getting illegal start of expression can someone look into the matter and provide a solution thanks.
    Error line is followed by a single line comment.
    For Loop illegal start of expression error-screenshot-309-.png

  2. #2
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default Re: For Loop illegal start of expression error

    <= not < =

  3. #3
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,876
    Rep Power
    5

    Default Re: For Loop illegal start of expression error

    Well your main problem is that the source contains absolutely no formatting at all, no wonder you can't spot problems in it yourself.

    I believe your problem will go away when you remove that extra space in there:

    Java Code:
    for (int month = 1; month <= 12; month++)
    But I can only guess since you choose to post a screenshot in stead of the actual code.

    Edit: ninja'd!

  4. #4
    Syed Rizvi is offline Member
    Join Date
    Jul 2013
    Posts
    8
    Rep Power
    0

    Default Re: For Loop illegal start of expression error

    Brother actually my question is a bit different from this. I got only this example from the internet I am posting you my actual question if you can provide any help.

    Write a program that displays the calendar for a given month of the year. The program prompts the user to enter the year and the month, and then displays the entire calendar for the month.

  5. #5
    Syed Rizvi is offline Member
    Join Date
    Jul 2013
    Posts
    8
    Rep Power
    0

    Exclamation Help To Write This Program

    Hello Guys,
    I Need your help to write the following program i actually dont understand the question correctly. This question is as follows:

    Write a program that displays the calendar for a given month of the year. The program prompts the user to enter the year and the month, and then displays the entire calendar for the month.

  6. #6
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,949
    Rep Power
    19

    Default Re: Help To Write This Program

    What have you done so far and where are you stuck?
    Please provide any compilation errors.
    If it executes then provide full stack traces, pointing out in your code where the exception is thrown.
    If there are no exceptions then explain why what you see is not what you expect to see.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  7. #7
    Syed Rizvi is offline Member
    Join Date
    Jul 2013
    Posts
    8
    Rep Power
    0

    Default Re: Help To Write This Program

    I have just begin to write do I need to use the calendar instance to get any year the user enters and any month that user enters.

  8. #8
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,949
    Rep Power
    19

    Default Re: Help To Write This Program

    Without code it's hard to tell what "calendar instance" you are talking about.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  9. #9
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default Re: For Loop illegal start of expression error

    Finished.

  10. #10
    harshit shah is offline Member
    Join Date
    Jan 2013
    Location
    Kolkata,India
    Posts
    86
    Rep Power
    0

    Default Re: Help To Write This Program

    Isn't this the thread where you asked this question?? For Loop illegal start of expression error

    please do not start multiple threads.

  11. #11
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default Re: Help To Write This Program

    He's just another "Giv me teh kodez" poster, anyway. Just ignore.

    Nothing to see here, please move along.
    harshit shah likes this.

  12. #12
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,436
    Blog Entries
    7
    Rep Power
    20

    Default Re: For Loop illegal start of expression error

    The two threads on the same topic are merged. @OP: don't start mutiple threads on one and the same topic.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

Similar Threads

  1. Error: illegal start of expression
    By iswan in forum JDBC
    Replies: 2
    Last Post: 09-28-2011, 09:29 AM
  2. For Loop, illegal start of expression
    By Slinkie45 in forum New To Java
    Replies: 6
    Last Post: 05-11-2011, 01:35 AM
  3. Illegal start of expression error pls help me!
    By Gayethiri_86 in forum New To Java
    Replies: 12
    Last Post: 05-12-2010, 03:06 PM
  4. Illegal start of expression error
    By lukermsdn111 in forum New To Java
    Replies: 9
    Last Post: 03-22-2010, 01:31 PM
  5. Servlet Error -illegal start of expression
    By raghu9198 in forum Java Servlet
    Replies: 2
    Last Post: 04-21-2009, 11:12 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •