Jump to content

Want to make conditions to IF ELSE - but how?

- - - - -

  • Please log in to reply
1 reply to this topic

#1
Budgie

Budgie

    Newbie

  • Members
  • Pip
  • 1 posts
Hello i want to translate that condition code into a IF ELSE CODE,...can somebody help me?

f.compareTo(m) == 0 ?
fahrrad : f.compareTo(l) == 0 ?
fahrrad : m.compareTo(l) == 0 ?
meter : f.compareTo(m) == 1 ?

m.compareTo(l) == 1 ?
meter : f.compareTo(l) == 1 ?
lenkrad : fahrrad : m.compareTo(l) == -1 ?
meter : f.compareTo(l) == 1 ?
fahrrad : lenkrad;

}

#2
ZekeDragon

ZekeDragon

    Writes binary right handed and hex left handed

  • Moderators
  • 2,103 posts
You'll need to clarify the question. Right now all I see are some equality comparisons using compareTo() to compare two elements we know nothing about. Assuming you implemented these compareTo methods correctly, I don't know how you've structured your if statement, so the best advice I can offer is to look into the logical NOT operator (!) and to use else if to have another conditional.
Wow I changed my sig!




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users