That's correct. As a work around, chose an int value to represent the "?".
For example:
final static int QuestionMark = 54321; // this value represents a "?"
theArray[i] = QuestionMark; // ...
Type: Posts; User: Norm
That's correct. As a work around, chose an int value to represent the "?".
For example:
final static int QuestionMark = 54321; // this value represents a "?"
theArray[i] = QuestionMark; // ...
As Greg said: All elements of an array must be of the same type.
Why do you want a value in an int array to be a "?"?
You could chose one of the possible int values to represent a "?" and use...
The code in post#1 works for me. Are there any lines in source.txt?
It should be false after the lines are read.
Have you tried debugging the code by adding a call to println() inside the loop to print out the value of line each time it is assigned a value?