How to generate random names in java

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • venkatcute
    New Member
    • Mar 2007
    • 1

    #1

    How to generate random names in java

    Dear Members,

    I have just started programming java. My teacher gave me an assignment
    where i have to create an array of objects of arbitrary length ( length decided by the user). Each object shoud have the following structure. Name(String), age and income. When the user inputs say 15, then the program must generate 15 objects with random names, age and income.

    I know only Math.random which generates random numbers. Is there any other
    method which creates random strings?

    Please advise me .

    Thank you
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by venkatcute
    Dear Members,

    I have just started programming java. My teacher gave me an assignment
    where i have to create an array of objects of arbitrary length ( length decided by the user). Each object shoud have the following structure. Name(String), age and income. When the user inputs say 15, then the program must generate 15 objects with random names, age and income.

    I know only Math.random which generates random numbers. Is there any other
    method which creates random strings?

    Please advise me .

    Thank you
    Let's start with your object first.
    You realize of course that you need a Class (maybe called Employee)?

    Comment

    Working...