Jason Bourne

Greenhorn
+ Follow
since Oct 06, 2005
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jason Bourne

Hi there,

I have a question with respect to searching the forums. I feel it would be much better if the search feature (at least a basic one) was available on all forum pages, instead of having to open another link.

My 2 Cents.

Regards,
Jason.
16 years ago
Hi Guys,

I wonder if that Java 7 comment was a joke. Either way, thanks for your replies. I will live with the problem, for now.

Thanks,
Jason.
16 years ago
Hi,

I have got 2 questions here. I would like to know why the following conversion is messed up.



As you may see, the BigDecimal is way off the mark. Why is it so?

The second question is, why is it so inconvenient to perform arithmetic on BigDecimals? I was being lazy and used double to calculate and printed as a BigDecimal so that I can see the full result of my calculation. Printing a double results in use of exponential notation. The arithmetic part is a bit complicated as well and I don't want to make too many function calls which I would end up doing if I used numbers of "BigDecimal" type.

Can you suggest an alternative?

Thanks,
Jason.
16 years ago
well, use sleep(msec) when you know for sure that you wont need the application to run for that period (at the least). Note that this period could extend. This can be used in animations or games without much interaction, timers, in particular.

wait() is used when you wont need the object till a particular action or event takes place. And a waiting thread could be woken immediately or never be.
It seems like you didn't read the article. I am not talking about bytecode here. The article talks about the way memory is allocated to objects and how JVM has improved. Please spend some time on it.
18 years ago
Well, atleast that is what this article says. Click for article.

Also, in the article, the author says pooling is a performance loss for all but heavyweight objects. Then, what about the String pool?
18 years ago
Thanks guys.... Now i understand threads better. And Mr.Wong, I am a Ludlum fan.
I am sorry i am still not quite convinced. A call to the start() method merely puts the thread in the runnable state from the ready state. Not in running(executing).So after start() returns, it is still possible that the thread is not actually executing. So the isAlive() will return false as it checks only for execution of the thread on which it is called. As per java 1.4.2 api reference available at this page. But i am most probably wrong. Correct me please.

And Mr.Hill, sorry about the name and my language. I obviously made the mistake of not reading the rules.
The question remains as to what 'start' means. According to the API, for start() method, start means beginning execution. And isAlive() method checks if the method has started and is not yet dead. So the first statement to check the thread state can be either true or false, as Lamont has previously said. I dont agree with the sheriff on this. Pls clarify if u r v.sure of urself.