public class GuessAnimal {
public static void main(String[] args) {
String animal = "unknown";
int weight = 700;
char sex = 'm';
double colorWaveLength = 1.630;
if(weight >= 500) { animal = "elephant"; }
if(colorWaveLength > 1.621) { animal = "gray " + animal;}
if (sex <= 'f'){animal = "female " + animal;}
System.out.println("The animal is a " + animal);
}
}
The above code is an example from a book and i wanted to know why does colorWaveLength print before weight?
Thanks

New Topic/Question
Reply



MultiQuote



|