Click here to Skip to main content
15,898,371 members
Home / Discussions / Java
   

Java

 
GeneralRe: help.... Pin
SilimSayo19-Dec-11 15:44
SilimSayo19-Dec-11 15:44 
AnswerRe: help.... Pin
TorstenH.29-Nov-11 0:00
TorstenH.29-Nov-11 0:00 
GeneralRe: help.... Pin
Richard MacCutchan29-Nov-11 0:47
mveRichard MacCutchan29-Nov-11 0:47 
GeneralRe: help.... Pin
TorstenH.29-Nov-11 19:38
TorstenH.29-Nov-11 19:38 
Questionhow to create constructor for array? Pin
rohaya8815-Nov-11 0:53
rohaya8815-Nov-11 0:53 
AnswerRe: how to create constructor for array? Pin
TorstenH.15-Nov-11 1:16
TorstenH.15-Nov-11 1:16 
GeneralRe: how to create constructor for array? Pin
rohaya8815-Nov-11 1:46
rohaya8815-Nov-11 1:46 
GeneralRe: how to create constructor for array? Pin
TorstenH.15-Nov-11 2:01
TorstenH.15-Nov-11 2:01 
a bit confusing.

You have a list of roster and a roster has like 30 int values in a array.


Java
while ((input = in.readLine()) != null) {
   StringTokenizer st = new StringTokenizer(input,",");
   for(int i=0;i<shift.length;i++) {
      shift[i]= Integer.parseInt(st.nextToken());
      R=new Roster(shift);
   }
   RosterList.add(R);
}


Is that correct?
You are going through that file "roster.txt". One text line presents a Roster object.
You're reading one integer and renew the Roster object "R" each time (bad - init the Roster object afterwards!).
After that you're adding the filled Roster object to a list "RosterList".

Questions:

- What happens if there are more int values in the line than the initial size of shift (fixed to 30 values)??
- What happens if one value is not valid?
- What to do with FileWriter "out2" and "out3"?
regards Torsten
I never finish anyth...

GeneralRe: how to create constructor for array? Pin
rohaya8815-Nov-11 2:12
rohaya8815-Nov-11 2:12 
GeneralRe: how to create constructor for array? Pin
TorstenH.15-Nov-11 2:56
TorstenH.15-Nov-11 2:56 
AnswerRe: how to create constructor for array? Pin
mirzabeigi8-Dec-11 7:43
mirzabeigi8-Dec-11 7:43 
SuggestionRe: how to create constructor for array? Pin
RaviRanjanKr1-Jan-12 1:57
professionalRaviRanjanKr1-Jan-12 1:57 
QuestionHow can I disable my Window 7 Desktop in Java Pin
flashery12-Nov-11 15:20
flashery12-Nov-11 15:20 
AnswerRe: How can I disable my Window 7 Desktop in Java Pin
RaviRanjanKr12-Nov-11 20:28
professionalRaviRanjanKr12-Nov-11 20:28 
GeneralRe: How can I disable my Window 7 Desktop in Java Pin
flashery12-Nov-11 23:52
flashery12-Nov-11 23:52 
AnswerRe: How can I disable my Window 7 Desktop in Java Pin
Member 835399113-Nov-11 1:40
Member 835399113-Nov-11 1:40 
AnswerRe: How can I disable my Window 7 Desktop in Java Pin
Nagy Vilmos13-Nov-11 23:46
professionalNagy Vilmos13-Nov-11 23:46 
GeneralRe: How can I disable my Window 7 Desktop in Java Pin
flashery14-Nov-11 1:14
flashery14-Nov-11 1:14 
GeneralRe: How can I disable my Window 7 Desktop in Java Pin
Nagy Vilmos14-Nov-11 1:30
professionalNagy Vilmos14-Nov-11 1:30 
GeneralRe: How can I disable my Window 7 Desktop in Java Pin
flashery14-Nov-11 1:33
flashery14-Nov-11 1:33 
AnswerRe: How can I disable my Window 7 Desktop in Java Pin
jschell14-Nov-11 8:18
jschell14-Nov-11 8:18 
AnswerRe: How can I disable my Window 7 Desktop in Java Pin
TorstenH.14-Nov-11 22:18
TorstenH.14-Nov-11 22:18 
GeneralRe: How can I disable my Window 7 Desktop in Java Pin
flashery14-Nov-11 23:04
flashery14-Nov-11 23:04 
GeneralRe: How can I disable my Window 7 Desktop in Java Pin
TorstenH.14-Nov-11 23:28
TorstenH.14-Nov-11 23:28 
GeneralRe: How can I disable my Window 7 Desktop in Java Pin
flashery14-Nov-11 23:34
flashery14-Nov-11 23:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.