Scala: what has been the desired design consideration for the null instantiation in the example

by Yordan Georgiev   Last Updated August 10, 2018 12:05 PM

Or simply asked WHY ?
It simply does not seems logical ...

if ( null.asInstanceOf[String]  == null )  println 
("null.asIstanceOf[String] is null")

println ("BUT !!!")

if ( null.asInstanceOf[Double] == 0.0 ) println ( 
"null.AsInstanceOf[Double] is 0 !!" )
Tags : scala variables


Related Questions


Grabbing all variables from file C++

Updated June 09, 2016 08:02 AM

How complex a program can be without variables?

Updated March 26, 2017 13:05 PM

Java Variables Question

Updated June 26, 2016 08:02 AM

Standard Variable nomenclature

Updated June 19, 2018 17:05 PM