Why int and float== with the same value are true?

 public static void main(String[] args) {
        System.out.println(100==100.0f);
    }
Apr.22,2021

= types are automatically converted when comparing.

clipboard.png

Menu