What is printed?

```java
public class Test {
public static void main(String[] args) {
int j = 0;
int i = ++j + j * 5;

System.out.println("What is i? " + i);
}
}
```

A. 1
B. 5
C. 0
D. 6



Answer :

To solve the problem, we'll follow the operations step by step in the provided code.

1. Initialization:
```java
int j = 0;
```
Initially, the variable `j` is set to 0.

2. Increment `j`:
```java
int i = ++j + j 5;
```
The `++j` operation increments the value of `j` by 1 before it is used. So, `j` becomes 1.

3. Calculate i:
- After the increment, `j` is now 1.
- Next, we evaluate the expression `++j + j
5`.
- Since `++j` increments `j` to 1 beforehand, we have:
```java
i = 1 + 1 * 5;
```
- Perform the multiplication first:
```java
i = 1 + 5;
```
- Next, perform the addition:
```java
i = 6;
```

4. Print the Result:
```java
System.out.println("What is i? " + i);
```
This prints:
```
What is i? 6
```

Therefore, the value of `i` printed is `6`.