Results 1 to 2 of 2
- 04-15-2010, 06:04 PM #1
Member
- Join Date
- Apr 2010
- Posts
- 5
- Rep Power
- 0
Creating an arbitrary number of variables
Hi,
I have the following problem. I've written a program which reads a txt file which contains an arbitrary number of lines with names. What I want is to store these names in variables. To make this more clear lets say that I have a file like that:
George
Nick
Helen
I want my program to read through this file and create as many variables as the names in it. That is:
x="George";
y="Nick";
z="Helen";
But if I don't know the number of the variables from the beginning (because as I said the namelist length is arbitrary) how can I create that many variables??
- 04-15-2010, 06:10 PM #2
Similar Threads
-
Printing the Number of Times a Number in a Range Shows up
By space4rent00 in forum New To JavaReplies: 1Last Post: 02-05-2010, 10:42 PM -
What are Instance variables and static variables?
By sandeshforu in forum New To JavaReplies: 3Last Post: 09-09-2009, 05:48 PM -
Creating a Number Input Dialog in SWT
By Java Tip in forum SWTReplies: 0Last Post: 07-02-2008, 07:53 PM -
Create a VeryLong class that will store an integer of arbitrary length.
By hey in forum New To JavaReplies: 2Last Post: 12-12-2007, 05:01 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks