11. Generalizations

about second instruction, what should i do?

1 Like

Here is what the second instruction says:

Use a Boolean expression that will print out the code in the else block of the if/else statement.

In order to make the else block print out, your Boolean expression must evaluate to false. Are you having trouble coming up with an expression that is false?

I had trouble with this at first, but what it is saying is that you have to do boolean tricky = false;
thats it.

1 Like


public class And {
public static void main(String args) {

	System.out.println(56<87 && 66<67);


see here , i think it might help…

this is how condition works

i get error for what expression that i write.

You have to change the initial condition of the IF statement.

For instance, I changed the if(2015 < 2016) to if(2015 < 2011). This is actually what it wants - a bit confusing, I know.

Try doing this - if( ! ( 2015 < 2016))… It should be able to execute…

A post was split to a new topic: Won’t let me go through next chapter