O
Obi Wan Shinobi
Hello people,
Would someone please tell me why the following code (which I pretty
much copied out word for word from Wrox' Beginning Java 1.4 book) is
giving me a 'cannot resolve sybol error' referring to the first
character inside the catch condition: (IOException e):
public class AverageFruit {
public static void main(String[] args) {
double numOranges = 50.0E-1;
double numApples = 1.0E1;
double averageFruit = 0;
averageFruit = (numOranges + numApples) / 2.0;
System.out.println("A totlly fruity program");
System.out.println("Average fruit is " + averageFruit);
System.out.println("(Press Enter to exit)");
try {
System.in.read();
} catch (IOException e) {
return;
}
}
}
As you might have guessed i'm just starting out Java, so any help
would be greatly appreciated.
- Obi Wan
Would someone please tell me why the following code (which I pretty
much copied out word for word from Wrox' Beginning Java 1.4 book) is
giving me a 'cannot resolve sybol error' referring to the first
character inside the catch condition: (IOException e):
public class AverageFruit {
public static void main(String[] args) {
double numOranges = 50.0E-1;
double numApples = 1.0E1;
double averageFruit = 0;
averageFruit = (numOranges + numApples) / 2.0;
System.out.println("A totlly fruity program");
System.out.println("Average fruit is " + averageFruit);
System.out.println("(Press Enter to exit)");
try {
System.in.read();
} catch (IOException e) {
return;
}
}
}
As you might have guessed i'm just starting out Java, so any help
would be greatly appreciated.
- Obi Wan