Question: I have tried to do this in java however the **&&** symbols keep on giving error.  

Below is the code that I used:

```java
int d = 18;

    {
    if ((d % 2) && (d% 3));
    {
        System.out.println("True!");
    }

    {
        System.out.println("False!");
    }
}

```

This is my code. I am not sure why its not working. Thanks 

The error message is **The operator && is undefined for the argument type(s) int, int. #**

I have got it to work now. I have an else error . "The error says Syntax error on token "else", delete this token"

```java
public class CS1702_Lab3_4 {

    int d = 18;

    {
        if ((d % 2 == 0) && (d % 3 == 0));
        {
            System.out.println("True!");
        }
        else
        {
            System.out.println("False");
        }
        }
}

```

Also when I add an else it says **Syntax error on token "else", delete this token**

Answer: 
Please learn about the modulus operator, and how to [check divisibility in java](https://stackoverflow.com/questions/8260690/how-to-check-if-number-is-divisible-by-a-certain-number).

```
if ((d % 2 == 0) && (d % 3 == 0))
{
    System.out.println("True!");
}

```

Also, you had a rogue semi-colon at the end of your if statement.

EDIT: Fixed code

```
public class CS1702_Lab3_4 {

    public static void main(String[] args) { // Entry into our program
        int d = 18;

        if ((d % 2 == 0) && (d % 3 == 0)) {
            System.out.println("Divisible!");
        } else {
            System.out.println("Not divisible!");
        }
    }

}

```

I'd recommend looking at some basic Java tutorials, however the fixes I applied included:

* Contained your code inside of a method, specifically the main method, which is the entry point to a runnable Java application. Java is not a procedural language, code outside of variable, method, class, package and import declarations need to be contained inside of a method
* Fixed syntax on your if statement, removed rogue semi colon
`if` condition expects boolean. `Mod` operation would not return boolean, this is why compiler is intelligent and gives you this error.

if you try to run 

```
 if (1 && 2) // this will give you an error as well. 

```

The expressions need to evaluate to a boolean (either true or false) in order to understand operators like && and ||

Moreover, you statement will not work since you are using `;` at the end.