File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Thread t = primitive value? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Thread t = primitive value?" Watch "Thread t = primitive value?" New topic

Thread t = primitive value?

Monica Dharwad

Joined: Aug 14, 2006
Posts: 8
Can Thread t = primitive value?
I guess no but want to confirm.
Thanks a lot.
Christophe Verré

Joined: Nov 24, 2005
Posts: 14688

How could it be possible ? What makes you think that it could possibly be ?
Wrapper classes, like java.lang.Integer can take advantage of auto-boxing to do such an assignment. Not classes other than wrapper classes.

[My Blog]
All roads lead to JavaRanch
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2904

Monica Dharwad wrote:Can Thread t = primitive value?

Provided, "primitive value" is an object of some class, then with casting you can do it

[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
Treimin Clark
Ranch Hand

Joined: Nov 12, 2008
Posts: 757
Monica Dharwad wrote:I guess no but want to confirm.

Why don't you give a try yourself? Self practicing is very important to pass any certification test.
I agree. Here's the link:
subject: Thread t = primitive value?
It's not a secret anymore!