1public class PositiveNegative {
2
3 public static void main(String[] args) {
4
5 double number = 12.3;
6
7 // true if number is less than 0
8 if (number < 0.0)
9 System.out.println(number + " is a negative number.");
10
11 // true if number is greater than 0
12 else if ( number > 0.0)
13 System.out.println(number + " is a positive number.");
14
15 // if both test expression is evaluated to false
16 else
17 System.out.println(number + " is 0.");
18 }
19}