Originally posted by Santhosh Kumar:
That is because, all numeric literal are integers by default in Java. If you want JVM to consider that numeric literal as long, you need to be explicit about it.
Say it as (note the small l at the end, which says, my literal is long)
long l = 2342444324324423l;
i m strongly aganinst this statement...because
as i didn't heard about this anywhere can you show me where its written in K&B and i wanted to say that
if it is integer...then it must be automatcially cast to long as
int->long implicitly castable and in above original post the left side declaration is already long so there should not be any problem ...
pls correct me ..i m much confused and if possible give me the link where its written or copy past from K&B ebook