Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1
Line 6 is modulus division => it gives the reminder of the division. Line 7 is the ternary operator => if the condition x < 0 is true it returns the value after "?", if it's false the value after ":". You can find more info here: https://www.tutorialspoint.com/java/java_basic_operators.htm and here: https://www.w3schools.com/java/java_conditions.asp
26th Apr 2019, 7:50 AM
TheWh¡teCat 🇧🇬
TheWh¡teCat 🇧🇬 - avatar