Illegal Start of Expression Error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Mani loveypal
    New Member
    • Oct 2011
    • 1

    Illegal Start of Expression Error

    I am getting an error:
    Illegal start of expression in line no 5 public static void main

    Could you please explain what I'm doing wrong.

    Here is my code:
    Code:
    //Demonstrate continue
    
    class continue
    {
      public static void main(String args[])
      {
        for(i=0;i<10;i++)
        {
          System.out.print(i+" ");
          if(i%2==0)continue;
          System.out.println("");
        }
      }
    }
    Last edited by Frinavale; Oct 14 '11, 04:23 PM. Reason: Added the question and error message to the body of the thread.
  • aswal
    New Member
    • Aug 2013
    • 38

    #2
    You have used a keyword of java for class name which is prohibited. That's why it is showing this error.

    Comment

    Working...