Question: What is the error in the following program written in Java? public class Bools { public static void main ( String [ ] args )

What is the error in the following program written in Java?
public class Bools{
public static void main(String[] args){
int a =-8;
double b =9.25;
System.out.println(a && b ==3.0);
System.out.println(a || b <=5.0);
}
}
Must include parentheses around Boolean expressions
Cannot compare numeric values with and and or
Any value compared with b will not be a whole number
The class name Bools is not allowed

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!