Image

Imagechixor1 wrote in Imagejava_dev 😯confused

Boolean Values?

Forgive me for being really silly with these questions, however I am having trouble determining whether I am inserting the correct information for an assignment im working on.

My task is to return "True" if my integer is Even and "false" if my integer is not.
Im using the remainder operator, do divide the integer entered by the user by 2.
then Im stating:

if ( result = 0 )
        answer = true;
  
   else answer = false;

Now in my head im thinking that "answer" should be declared as a boolean value, since it can only either be true, or false.
But im recieving an error stating that "cannot convert double to boolean".

Thanks in advance, of the fulle code is required I am more than happy to provide.