File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes a question on thread flow 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 "a question on thread flow" Watch "a question on thread flow" New topic
Author

a question on thread flow

Vad Fogel
Ranch Hand

Joined: Aug 25, 2003
Posts: 504
Hi all, can you tell me how to approach questions like this?
Barkat Mardhani
Ranch Hand

Joined: Aug 05, 2002
Posts: 787
Hi Vad,
I would say 4 objects per notes in the code below:

[ October 07, 2003: Message edited by: Barkat Mardhani ]
Vad Fogel
Ranch Hand

Joined: Aug 25, 2003
Posts: 504
My doubt is what if the scheduler decides to finish off the main() thread first and only then execute the new thread? Then, 2 String constants would be put in the constant pool to be reused in the run() method (then, "abc" and "cde" objects wouldn't be created?)
Yeah, after thinking awhile on my own stuff, I see you're right
4 objects will be created anyway. The difference would appear should I have different String constants in the main(). Or would it?
[ October 07, 2003: Message edited by: Vad Fogel ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: a question on thread flow
 
Similar Threads
creating a list of subsets from N elements
equals() and ==, doubt
string to int
kindly explain this strange behaviour of == and inerface
String == operator