Friday, 27 September 2013

Illegal Start of Expression Java Boolean?

Illegal Start of Expression Java Boolean?

I'm trying to run a Bitwise number comparison and my code keeps coming up
with an Illegal start of expression on line 30 of my code with the "if"
statement.
My code reads as so:
public class Project7 {
public static void main(String[] args) {
Scanner keyboard = new Scanner(System.in);
double P = keyboard.nextDouble();
double Q = keyboard.nextDouble();
double R = keyboard.nextDouble();
double S = keyboard.nextDouble();
boolean First_Relation;
boolean Second_Relation;
if (P>Q) First_Relation = true;
if (R<S) Second_Relation = true;
if
(First_Relation = true) & (Second_Relation = true);
System.out.println("Given the values for p,q,r, and s the expression "
+ "(p > q) && !(r < s) evaluates to " );
}

No comments:

Post a Comment