juan_gandhi: (VP)
2016-11-06 08:37 am
Entry tags:

Java puzzlers

  @Test public void null_is_null() {
    Double Null = ((Double)null);
    boolean itis = Null instanceof Double;
    assertTrue(itis);
  }


Comments? I'm pretty much lost here.
juan_gandhi: (VP)
2016-08-31 07:45 am
Entry tags:

another scala fun

scala> class A[T] { var x:T = _ }
defined class A

scala> val aInt = new A[Int]
aInt: A[Int] = A@36f6e879

scala> aInt.x
res2: Int = 0

  Until you take a closer look:

scala> class A[T] { var x:T = _; println(x) }
defined class A

scala> val aInt = new A[Int]
null
aInt: A[Int] = A@3fee9989

scala> aInt.x
res3: Int = 0


null magically turns into 0.
juan_gandhi: (VP)
2014-08-28 03:56 pm
Entry tags:

just got rid of nulls

In the code I'm working with.