Results 1 to 2 of 2
  1. #1
    eppoair2 is offline Member
    Join Date
    Nov 2010
    Location
    Virginia
    Posts
    14
    Rep Power
    0

    Default Why the following code wouldn't compile. Please advise

    if !x > x + y
    x = 2 * x;
    else
    x = x + 3;

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,433
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by eppoair2 View Post
    if !x > x + y
    x = 2 * x;
    else
    x = x + 3;
    The syntax is rubbish (Java-wise, that is) and semantically the (crippled) if condition is only true if y < 0. What did you have in mind when you made this up?

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

Similar Threads

  1. Can't compile and run Java code
    By quicksun in forum New To Java
    Replies: 7
    Last Post: 02-25-2011, 01:58 PM
  2. Can not compile code , anyone help me fix it ?
    By batista11b5 in forum New To Java
    Replies: 3
    Last Post: 10-22-2010, 02:00 PM
  3. Code does not Compile
    By ustar in forum New To Java
    Replies: 13
    Last Post: 03-06-2010, 04:54 PM
  4. New to JAVA and code cant compile
    By Gayethiri_86 in forum New To Java
    Replies: 2
    Last Post: 03-05-2010, 06:43 AM
  5. Code will not compile
    By ShotGunRockets in forum New To Java
    Replies: 17
    Last Post: 05-10-2009, 03:31 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
  •