Confusion in exercise


#1

else if ( !(true == true) )
what it mean in java ?


#2

Hey there! I think you already know what the else if -statement does.
Let's look at the condition that will be met:

( ! (true == true) )
  2          1

1.) Here we check if true is equal to true, which it is.
2.) Here we see an exclamation mark, the not-operator. This means that whatever is the return of the preceding block ( (true == true) ) is, will be inverted. But this goes for booleans only.

Example:

!true = false
!false = true

( (1 + 1) == 2 )  -> true
!( (1 + 1) == 2 ) -> false

#3

thanks it's clear all confusion


#4

I'm happy to hear that!