The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
February 2002



This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.


Final Random Comments

Posted by Matt Gerrans on February 20, 2002 at 2:03 PM

> I am new to answring questions on forum. And its really nice to learn lot of stuff in thinking differences from you Matt Gerrans.

> When I was answering what I had in mind was to give a pointer to the person rather than giving a solution.

> But the way you have answered the question, it addresses lot of issues and makes lot of points clear. Have to learn lot I guess :-)

> By the way the use of the final key word when declaring Random achieves what purpose?

You are too kind, Senthoor!

I'm sure the question askers are grateful for any good answers they get (and you've provided many), but I also like to throw in a little extra. I like to try and add some encouragement for good programming style and habbits. Of course, people are free to ignore this part, but I think it can useful to those beginners who want to hone their craft.

As far as making the random variable final, it is not a critical issue in this case, but is just a guarantee that it won't be assigned to any other object (or null) at some later time.

  • hehe Chin Loong February 24, 2002 at 11:26 PM (0)

Sponsored Links

Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us