Results 1 to 6 of 6
  1. #1
    mokitooo_1994 is offline Member
    Join Date
    May 2011
    Posts
    2
    Rep Power
    0

    Default Error: "Illegal start of expression"

    When I compile this script, it sends me an error, "Illegal start of expression", on the 4th line of the next script:

    public void timeTick()
    {
    minutes.increment();
    if(minutes.getValue() == 0) && (hours.value < 11)// it just rolled over!
    hours.value = hours.value + 1;

    updateDisplay();
    }


    What's wrong here??? please helppp!

  2. #2
    j2me64's Avatar
    j2me64 is offline Senior Member
    Join Date
    Sep 2009
    Location
    Zurich, Switzerland
    Posts
    962
    Rep Power
    12

    Default

    where does minutes, hours come from? please post all the code used in timeTick().

  3. #3
    eRaaaa is offline Senior Member
    Join Date
    Oct 2010
    Location
    Germany
    Posts
    785
    Rep Power
    12

    Default

    you close the if statement early :D

    if(minutes.getValue() == 0) && (hours.value < 11)

    --->

    if(minutes.getValue() == 0 && hours.value < 11)

  4. #4
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,068
    Blog Entries
    3
    Rep Power
    14

    Default

    Quote Originally Posted by eRaaaa View Post
    you close the if statement to early

    if(minutes.getValue() == 0) && (hours.value < 11)

    --->

    if(minutes.getValue() == 0 && hours.value < 11)

    Or

    Java Code:
    if((minutes.getValue() == 0) && (hours.value < 11))

  5. #5
    mokitooo_1994 is offline Member
    Join Date
    May 2011
    Posts
    2
    Rep Power
    0

    Default

    Quote Originally Posted by eRaaaa View Post
    you close the if statement early :D

    if(minutes.getValue() == 0) && (hours.value < 11)

    --->

    if(minutes.getValue() == 0 && hours.value < 11)
    Quote Originally Posted by sunde887 View Post
    Or

    Java Code:
    if((minutes.getValue() == 0) && (hours.value < 11))
    Ohh thanks!!! ;)

  6. #6
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,068
    Blog Entries
    3
    Rep Power
    14

    Default

    Mine and his were really the exact same thing, it may be easier to group up and separate conditions as I did though.

Similar Threads

  1. "illegal start of expression"
    By 3RDofApril in forum AWT / Swing
    Replies: 2
    Last Post: 11-04-2010, 02:39 AM
  2. Illegal start of expression error pls help me!
    By Gayethiri_86 in forum New To Java
    Replies: 12
    Last Post: 05-12-2010, 04:06 PM
  3. Illegal start of expression error
    By lukermsdn111 in forum New To Java
    Replies: 9
    Last Post: 03-22-2010, 02:31 PM
  4. Servlet Error -illegal start of expression
    By raghu9198 in forum Java Servlet
    Replies: 2
    Last Post: 04-22-2009, 12:12 AM
  5. Replies: 5
    Last Post: 03-20-2009, 11:04 PM

Tags for this Thread

Posting Permissions

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