I believe const is a keyword in
Java. Moreover, it is good practice to declare the variable as public static final instead of const . Having said all that, why does the following code gives me compile time error
[CODE]
class
test {
public static void main (
String args[]) {
const int i = 10;
}
}
/CODE]
Here is the error that I get when I compile the code
illegal start of expression
const int i = 10;
Am I using the wrong syntax ?
TIA
Cheers,<br />Jay<br /> <br />(SCJP 1.4)<br />Heights of great men were not achieved in one day, they were toiling day and night while their companions slept.