Results 1 to 2 of 2
  1. #1
    vasu18 is offline Member
    Join Date
    Dec 2007
    Posts
    3
    Rep Power
    0

    Default Identifier expected error

    Calendar cal1 = Calendar.getInstance();
    cal1.add(cal1.MONTH,-6);
    System.out.println(cal6.get(Calendar.MONTH));

    i am getting identifier expected error in line 2

    can any one help me out

  2. #2
    tim's Avatar
    tim
    tim is offline Senior Member
    Join Date
    Dec 2007
    Posts
    435
    Rep Power
    8

    Default

    Hello

    Make sure that you have imported java.util.Calendar. What is cal6? I removed the bug (cal6) in your code segment and found nothing wrong with the second line.

    Hope this helped. ;)
    Eyes dwelling into the past are blind to what lies in the future. Step carefully.

Similar Threads

  1. Error: ')' expected
    By baltimore in forum New To Java
    Replies: 1
    Last Post: 08-07-2007, 07:32 AM
  2. Error: <identifier> expected
    By barney in forum AWT / Swing
    Replies: 2
    Last Post: 07-31-2007, 08:38 AM
  3. Error: '{' expected
    By romina in forum New To Java
    Replies: 1
    Last Post: 07-26-2007, 10:34 AM
  4. My error is: ')' expected
    By silvia in forum New To Java
    Replies: 1
    Last Post: 07-18-2007, 05:49 PM
  5. MSG ERROR: : expected
    By Marty in forum New To Java
    Replies: 1
    Last Post: 05-31-2007, 03:21 AM

Posting Permissions

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