473,320 Members | 2,111 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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
Mar 19 '07 #1
1 5821
r035198x
13,262 8TB
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)?
Mar 19 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Yudan YI \(OSU\) | last post by:
I want to generate random data from a normal distribution, while I checked the functions, and I found rand(), which returns a pseudorandom integer between zero and RAND_MAX. I am not sure how to...
4
by: Marc Dansereau | last post by:
Hi all, I wonder what is the most efficient way to generate random point on a line defined by 2 double points (x0,y0) and (x1,y1). Here is the pseudocode of my method : for each point {...
7
by: MattB | last post by:
I have the following code to generate random passwords for new users of an application. Const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstyvwxyz1234567890" Dim r As Int16, i As...
6
by: comp.lang.php | last post by:
/** * Generate the random security image * * @access public * @param $willUseFilePath (default false) boolean to determine if you will be using a file path * @param mixed $filePath (optional)...
0
sashi
by: sashi | last post by:
Generate Random Password In the course of programming you may have cause to generate a password. The following function will generate a password of randomly selected characters up to a maximum of...
3
by: jjmontreal | last post by:
I would like to create a form where by clicking some where in the form it will generate a alphanumeric sequence. I want to generate random PIN numbers preceeded with specific letters. An example...
9
by: Chelong | last post by:
Hi All I am using the srand function generate random numbers.Here is the problem. for example: #include<iostream> #include <time.h> int main() {
24
by: pereges | last post by:
I need to generate two uniform random numbers between 0 and 1 in C ? How to do it ? I looked into rand function where you need to #define RAND_MAX as 1 but will this rand function give me ...
1
Srijith B
by: Srijith B | last post by:
HI all I am trying to write a perl script to generate random names ed. ( Qrhfh, Jdfhdh, Dfkjns) etc. So the script should ask me the number of random names and when I give say 4, It should give...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.