article thumbnail

Mangling JSON numbers

TechEmpower

If we have a long (64-bit integer) that we serialize into JSON, we might be in trouble if JavaScript consumes that JSON. JavaScript has the equivalent of double (64-bit floating point) for its numbers, and double cannot represent the same set of numbers as long. The output of x.toString() in JavaScript is suspicious.

article thumbnail

Everything about Java 8

TechEmpower

A common scenario in Java libraries is, for some interface Foo , there would be a companion utility class Foos with static methods for generating or working with Foo instances. An interface cannot provide a default implementation for any of the methods of the Object class. Why abstract classes can't be instantiated using a lambda.

Java 560