Jump to content

Iodyne

Members
  • Content Count

    1
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Iodyne

  • Rank
    Newbie
  1. Iodyne

    If Else

    Hi, I just discovered the "ternary operator" for if else and found the page on this website for it, here: https://www.w3schools.com/java/java_conditions.asp under "Short Hand If...Else (Ternary Operator)." The description states that it can be used "if you have only one statement to execute" but I believe that to be innacurate (or at least worded improperly/confusingly) and should be fixed. For example, the following code I've attached seems to work just fine: Likewise I've tested this format on another method with a length of 26 of these statements, (as opposed to just the two above), and so it appears the statments can be strung together practically without limit. I just figured the information should be a little clearer. There aren't many people who would try to test something which says it won't work.
×
×
  • Create New...