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;
}
1 reply to this topic
#1
Posted 19 May 2011 - 12:35 PM
|
|
|
#2
Posted 19 May 2011 - 03:18 PM
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


Sign In
Create Account

Back to top









