Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

public class Main {

    public static void main(String[] args) {
        double d1 = 5.5;
        double d2 = 5.4;
        int i1 = Double.compare(d1, d2);
        if (i1 > 0) {
            System.out.println(">");
        } else if (i1 < 0) {
            System.out.println("<");
        } else {
            System.out.println("=");
        }
        Double dObj1 = new Double("5.5");
        Double dObj2 = new Double("5.4");
        int i2 = dObj1.compareTo(dObj2);
        if (i2 > 0) {
            System.out.println(">");
        } else if (i2 < 0) {
            System.out.println("<");
        } else {
            System.out.println("=");
        }
    }
}