- Jan 12, 2003
- 219
- 0
- 0
Code:
import cs1.Keyboard;
public class ch3_6
{
public static void main (String[] args)
{
int i, q; // counter, user input
char x; // char for testing pos/neg/0
System.out.println ("enter a value");
q = Keyboard.readInt ();
while (q >= 1)
18 x = q.charAt (q, i);
i++;
System.out.println (x);
}
}
I get the error int cannot be derefrenced on line 18. Any ideas? I am trying to split an inputed int into chars. System.out.println (x) should print the value of the character through each run of the loop. Eventually i will need to use a switch statment to assign different cases for x but first i need to figure out why my .charAt method isn't working.
Any java programmers?
MasterSamwise