[hotjoe.com] HotJoe Java Help Forums
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Visit java.com
Please send email if you are having login problems - see the posts below for more info.
Hotmail and Yahoo! users - please see the Hotmail post or the Yahoo! post for information on lost emails.
HELP!!! - Information into an Array using scanner  XML
Forum Index » New to Java
Author Message
highburycottage

Newbie

Joined: 03/29/2007 15:25:40
Messages: 2
Offline

Can somebody please help me with this problem. I have to initiate an array and then enter information into it via the scanner utility from a csv file. I can get the correct code to create or iterate over the array.

My code is as follows:

Thanks very much in advance to anybody who can put me out of my misery.

This message was edited 1 time. Last update was at 04/05/2007 18:11:15

stdunbar

Newbie
[Avatar]

Joined: 06/22/2005 14:51:37
Messages: 849
Location: Superior, CO, USA
Offline

I'll be glad to help but where are you having problems? If you're getting an error or if the program isn't running the way you want let us know some details. The more information you can provide the better.

Thanks for using the forums at hotjoe.com
[WWW] [Yahoo!] [ICQ]
highburycottage

Newbie

Joined: 03/29/2007 15:25:40
Messages: 2
Offline

Scottish League Division 1,10
Airdrie United ,3,2,11,14,25
Clyde ,5,7,4,21,17
Dundee ,7,2,7,21,18
Gretna ,10,3,3,43,20
Hamilton Acas ,7,5,4,19,20
Livingstone ,6,6,4,21,15
Partick Thistle,8,4,4,25,29
Queen of South ,3,3,10,11,31
Ross County ,4,4,8,14,24
St Johnstone ,6,6,4,26,16

Above is the text file that I have to get into my system. The first line goes into the 'theLeague = new League(name, numberOfTeams);' under name and this works correctly. the second numberOfTeams(10) also has to create an array of ten teams. These ten teams Airdrie United down along with the numbers have to go into an Array. I am struggling to get the array to initialise and therefore am also struggling to get any of the information into it.

Thanks in advance
destin

Newbie
[Avatar]
Joined: 01/07/2006 19:13:04
Messages: 224
Offline

highburycottage wrote:

The teams array is declared to hold instances of the Team class, however you're setting it to an integer.

You're going to have to invoke one of the Team class's constructors to initialize each item in the array.

This message was edited 1 time. Last update was at 04/05/2007 18:14:41

[Email]
 
Forum Index » New to Java
Go to:   
Powered by JForum 2.1.9 © JForum Team
This site run by Scott Dunbar of Xigole Systems. © 2005-2011 - Scott Dunbar
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners
hotjoe.com, xigole.com, and Scott Dunbar have no affiliation with Oracle