I am getting the error .class expected but can not find a solution to change the line! Any ideas?
The method is-
private class DisplayNum开发者_如何学JAVA implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
intInput = String.valueOf(array[]);
finalArea.setText("\n" + intInput);
}
}
Now the problem is with the intInput
line, I am getting a .class expected and have been told I need to change the line in general but do not know what to make it.
intInput should be declared as String.
array should be array or array[0], and it should be fetched from event I guess.
String.valueOf(array[])
doesn't make any sense.
Assuming array is an int[] you would need to specify an index to get a particular value out of, for instance:
String intInput = String.valueOf(array[0]);
精彩评论