hey guys,

when do we use "long"? and what is it anyway? like:

public long someStuff(long n)
{
.....
.....
}

thanks :)

Recommended Answers

All 4 Replies

Its the same as int except that it holds very much larger numbers
For int, from -2147483648 to 2147483647, inclusive
For long, from -9223372036854775808 to 9223372036854775807, inclusive
You use it whenever you want an integer value that may be bigger than the largest int

Its the same as int except that it holds very much larger numbers
For int, from -2147483648 to 2147483647, inclusive
For long, from -9223372036854775808 to 9223372036854775807, inclusive
You use it whenever you want an integer value that may be bigger than the largest int

aha! thank u so much! very concise answer :D

That's "solved" then?

That's "solved" then?

yep, just marked it :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.