Hi there..

In sleep(5000) what type of data is 5000??? Is that an integer or byte or something.
Thanks in advance

Recommended Answers

All 3 Replies

long

Edit: As if the API docs for Thread couldn't have told you that, or what that number represents.

Actually, maybe this was a trick question on an SCJP type exam. It is suppossed to take a long, but a bare, non-decimal number hord-coded into code that way is an int (accepted by the method due to the "widening" principle).

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.