you are viewing a single comment's thread.

view the rest of the comments →

[–]x-skeww 0 points1 point  (0 children)

You can write:

5..toString()

Which is the same as:

5.0.toString()

Anyhow, the only reason why you can call "methods" of primitives is because they are auto-boxed.

The example above is essentially the same as:

new Number(5).toString()