Results 1 to 7 of 7
Thread: Array Question
- 06-04-2012, 07:07 PM #1
Member
- Join Date
- Jun 2012
- Posts
- 4
- Rep Power
- 0
- 06-04-2012, 07:10 PM #2
Re: Array Question
What have you tried? Where are you stuck?
I recommend googling something like "java arrays" to get started.How to Ask Questions the Smart Way
Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!
- 06-04-2012, 08:14 PM #3
Member
- Join Date
- Jun 2012
- Posts
- 4
- Rep Power
- 0
Re: Array Question
- 06-04-2012, 08:21 PM #4
Re: Array Question
How to Ask Questions the Smart Way
Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!
- 06-04-2012, 08:31 PM #5
Re: Array Question
The lines that you read in from the file are Strings, so just populate the array with those strings.
- 06-04-2012, 08:53 PM #6
Member
- Join Date
- Jun 2012
- Posts
- 4
- Rep Power
- 0
Re: Array Question
public static void nameMenu1(Scanner sc) throws FileNotFoundException{
File file = new File("names.txt");
Scanner inputFile = new Scanner(file);
Scanner[] madeArray = new Scanner[] {inputFile};
System.out.print(madeArray);
}
This all compiles, but gives me an error when I try to run it.
- 06-04-2012, 08:59 PM #7
Re: Array Question
What is the error? And what do you expect it to do? Why are you making an array of Scanners?
How to Ask Questions the Smart Way
Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!
Similar Threads
-
Question about a 2d array example
By silverglade in forum New To JavaReplies: 8Last Post: 06-06-2011, 11:56 PM -
Array question..
By gerarda in forum New To JavaReplies: 14Last Post: 03-02-2011, 01:42 AM -
Array question
By TaxpayersMoney in forum New To JavaReplies: 5Last Post: 06-11-2010, 01:41 AM -
Array Question
By sc001 in forum New To JavaReplies: 1Last Post: 02-14-2010, 04:57 AM -
array question
By dazednconfused in forum New To JavaReplies: 4Last Post: 09-15-2009, 05:44 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks