Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Thread question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide 1Z0-808 this week in the OCAJP forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Thread question" Watch "Thread question" New topic

Thread question

Mansi Dave
Ranch Hand

Joined: Aug 06, 2002
Posts: 49
Why is it possible to create threads without importing the java.lang.Thread class?
sun par
Ranch Hand

Joined: Oct 03, 2002
Posts: 257
it is because the java.lang package is imported by default in any java program

Sunita<br />SCJP 1.4
Shishio San
Ranch Hand

Joined: Aug 29, 2002
Posts: 223

7.5.3 Automatic Imports
Each compilation unit automatically imports all of the public type names declared in the predefined package java.lang, as if the declaration:
import java.lang.*;
appeared at the beginning of each compilation unit, immediately following any package statement.

Whatever doesn't kill us ...<br />Is probably circling back for another try.<br />SCJP 1.4
Mansi Dave
Ranch Hand

Joined: Aug 06, 2002
Posts: 49
Thanks for the info.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: Thread question