random number generator

hi,

from the JDK source codes, i noticed a code stating

"private static Random randomNumberGenerator".

So for this code, which is the data type? And in this instance, is randomNumberGenerator the variable name?

Thanks
eturfclubAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

suprapto45Commented:
Yes,

randomNumberGenerator is the variable name with the type of Random. You may be interested to look at what Random class contains.

Regards
Dave
0
eturfclubAuthor Commented:
random class in the util package?
0
mjmohanCommented:
Hi,
    randomNumberGenerator is the class instance for Random (class data type). If I am not wrong, you are referring to java.util.Random class.  This class is used to generate the random numbers.
   Java data types can be primitive (int, float etc.) or Objects (as in the example). Object values are created by instantiating classes, which may either be built-in or program-defined.
0
suprapto45Commented:
Yes,

it is in the java.util package.

So "private static Random randomNumberGenerator" is similar to "private static String randomNumberGeneratorString".

Regards
Dave
0
suprapto45Commented:
You may have a look on how to use Random class on URL below.

http://www.ibiblio.org/javafaq/course/week4/54.html

Regards
Dave
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.