When to use 0L?

Why is

long myVar= 0;

not ok

It IS OK.

and

long myVar= 0L;

recommended?

It makes it clear that you are assigning a long value to a long variable. No implicit promotion is needed. Explicit is always better than implicit.