Results 1 to 3 of 3
  1. #1
    poet is offline Member
    Join Date
    Sep 2009
    Posts
    6
    Rep Power
    0

    Default Java syntax I don't understand - assignment

    Greets,

    I have seen this syntax numerous times and I'm unsure how it works.
    Java Code:
    double theta = tipHigh ? -Math.PI/2 : thetaInc;
    could someone enlighten me?

    thanks

  2. #2
    mrmatt1111's Avatar
    mrmatt1111 is offline Senior Member
    Join Date
    Aug 2009
    Location
    San Jose, CA, USA
    Posts
    320
    Rep Power
    5

    Default

    It is short hand for:

    Java Code:
    double theta;
    if(tipHigh == true)
    {
       theta = -Math.PI/2;
    }
    else
    {
       theta = thetaInc;
    }
    My Hobby Project: LegacyClone

  3. #3
    poet is offline Member
    Join Date
    Sep 2009
    Posts
    6
    Rep Power
    0

Similar Threads

  1. Replies: 8
    Last Post: 02-17-2009, 12:57 PM
  2. Java JDBC/MySQL appropriate Syntax
    By thelinuxguy in forum Advanced Java
    Replies: 7
    Last Post: 02-10-2009, 07:57 PM
  3. Replies: 4
    Last Post: 06-25-2008, 08:09 PM
  4. java assignment, need help bad.
    By carlos123 in forum New To Java
    Replies: 1
    Last Post: 11-06-2007, 04:53 PM
  5. Help with my assignment java
    By toby in forum New To Java
    Replies: 1
    Last Post: 08-07-2007, 05:59 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
  •