Closed fjf2002 closed 1 month ago
Object o = Double.valueOf(42); println(o == 42)
... results in run time failure:
SystemException in thread main thread: System exception: TypeError: Cannot convert object to primitive value at $MainClass86.$main (File new file 0.java: 5)
... whereas the following code runs successfully:
Double o = Double.valueOf(42); println(o == 42)
Thank you! Compiler now issues compile time error: "Operator == is not defined for operands of type Object and int."
... results in run time failure:
... whereas the following code runs successfully: