wood burning stoves 2.0*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Threads 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 "Threads" Watch "Threads" New topic
Author

Threads

Ankur Jain Kothari
Ranch Hand

Joined: Feb 08, 2010
Posts: 154
How do i create four threads and each thread calculating the cube root of a different number?


Do What You Wanna Be....Taking Things The Way They Come
scjp 1.6 91 percent, scmad 90 percent(rounded off to nearest integer)
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9291
    
  17

There are many ways of doing it. Did you try to write some code by yourself?? Here's a structure of a program that can do it


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Ankur Jain Kothari
Ranch Hand

Joined: Feb 08, 2010
Posts: 154
ya thanks....i did it this way ? now i want to search a text file on the computer which has the four numbers...how can i do it? i dont want to store the file in the root of the web dir....
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9291
    
  17

So this has become a completely different question now. If the question is about reading a file from a web application, then the SCJP forum is not the appropriate place for this question. Start a new topic in a more appropriate forum...
Ankur Jain Kothari
Ranch Hand

Joined: Feb 08, 2010
Posts: 154
sorry.....its not the web directory....i dont want to store the text file in the root directory of the application.....not the web directory...how do i search the whole computer for the text file named cube.txt?
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18529
    
  40

Ankur Jain Kothari wrote:how do i search the whole computer for the text file named cube.txt?


Please show us what you did so far, and what problems you are having, and we can give you a hint in the right direction.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Threads
 
Similar Threads
Thread Question: Are they all "under" creator?
Thread Help Wanted
For those of you who are certified ......
thread safe for SecureRandom.nextBytes()?
To which of the following can we apply the synchronized keyword