Results 1 to 2 of 2
  1. #1
    Marty is offline Member
    Join Date
    May 2007
    Posts
    38
    Rep Power
    0

    Default MSG ERROR: : expected

    Java Code:
    /**
     * Write a description of class EvenOdd here.
     * @author (your name) 
     * @version (a version number or a date)
     */
    public class EvenOdd
    {
        public static void main(){ 
        
            for (int i=0; i < 40; i++){ 
            i % 2 == 0 ? System.out.println(i + "is an even number"); : System.out.println(i + "is an odd number");
            }   
        }
    }
    it returns me this error: MSG ERROR: : expected

  2. #2
    Nick15 is offline Member
    Join Date
    May 2007
    Posts
    38
    Rep Power
    0

    Default

    hello!!!!
    the problem is that ":" is expected, but it finds the ";" after the first println
    Last edited by Nick15; 06-01-2007 at 01:09 AM.

Similar Threads

  1. Identifier expected error
    By vasu18 in forum New To Java
    Replies: 1
    Last Post: 01-01-2008, 05:49 PM
  2. Error: ')' expected
    By baltimore in forum New To Java
    Replies: 1
    Last Post: 08-07-2007, 06:32 AM
  3. Error: <identifier> expected
    By barney in forum AWT / Swing
    Replies: 2
    Last Post: 07-31-2007, 07:38 AM
  4. Error: '{' expected
    By romina in forum New To Java
    Replies: 1
    Last Post: 07-26-2007, 09:34 AM
  5. My error is: ')' expected
    By silvia in forum New To Java
    Replies: 1
    Last Post: 07-18-2007, 04:49 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
  •