Re: 1.7 JRE library error?
Please highlight your code
BBCode Tutorial
Specifically
Highlight Tags
Except instead of just
[highlight]**Code**[/highlight]
do
[highlight=Java]**Code**[/highlight]
As for the error, update java. Ok re-read your paragrash about 5 times, you need to uninstall and reinstall, and see if that works.
For removing the older version, look here
Re: 1.7 JRE library error?
import java.io.BufferedReader;
import java.io.FileReader;
public class calculator {
static int a = 0;
static int b; //this is the first term
static int c; //this is the second term
static int d; //this is my final answers
public static void main(String args[]) throws Exception{
FileReader cats = new FileReader("File's Address");
BufferedReader dogs = new BufferedReader(cats);
String fish;
while((fish = dogs.readLine()) != null){
String[] variables = fish.split(" ");
a++;
b = Integer.parseInt(variables[0]);
String operator = variables[1];
c = Integer.parseInt(variables[2]);
switch(variables[1]){
case "+": d = b + c;
break;
case "-": d = b -c; //This was a much better plan than the fail IF/ELSE statements.
break;
case "/": d = b / c;
break;
case "*": d = b * c;
}
System.out.println("Problem " + a + ": " + b + operator + c + "=" + d);
}
}
}
Re: 1.7 JRE library error?
i think u must right click on your project --> properties --> in sources change source/binary format to jdk 1.7 --> in libaries java platform to 1.7