Results 1 to 3 of 3
  1. #1
    3RDofApril is offline Member
    Join Date
    Nov 2010
    Posts
    4
    Rep Power
    0

    Default "illegal start of expression"

    I have been trying to figure this out on my own for quite some time, and have checked through the tutorials and threads but can not seem to find an adequate answer. I keep receiving the error "illegal start of expression" on the line of the second "if". Please help! I know that there it nothing for the second "if" to do, but that isn't the source of the problem.

    Java Code:
    public void actionPerformed(ActionEvent e){
    		if ((e.getSource() == f1) && (f1R == true) && (player1ChoosingPiece == true)){
    			f1S = true;
    			player1ChoosingPiece = false;
    			player1ChoosingMove = true;
    			System.out.println("Player Red selected the piece on F-1");
    		}
    		if ((e.getSource() == e2) && (e2R != true) && (e2B != true) && ()(player1ChoosingMove == true)){
    		}
    
    	}

  2. #2
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,565
    Rep Power
    12

    Default

    The () on that line doesn't make sense and shouldn't be there.

    Also foo==true is the same as foo. And foo!=true is the same as !foo. That might make the line more readable.

  3. #3
    3RDofApril is offline Member
    Join Date
    Nov 2010
    Posts
    4
    Rep Power
    0

    Default

    EDIT: OH! I see what you're referring to, I have no idea how that got there or how I didn't see it...

Similar Threads

  1. illegal start of expression
    By rajivjoshi in forum New To Java
    Replies: 3
    Last Post: 05-31-2010, 09:12 AM
  2. Illegal start of expression
    By Basit56 in forum New To Java
    Replies: 2
    Last Post: 08-18-2009, 09:12 AM
  3. Replies: 5
    Last Post: 03-20-2009, 10:04 PM
  4. Illegal Start of an Expression
    By ddatta8 in forum New To Java
    Replies: 3
    Last Post: 12-20-2008, 08:40 PM
  5. Illegal Start of Expression
    By vince425 in forum New To Java
    Replies: 3
    Last Post: 10-18-2008, 07:41 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
  •