The following code snippets probably won't work as you might expect.
For each snippet
1. Dry run the code and predict what will happen
1. Code won't run due to errors
2. Code runs but nothing is output.
3. Something is output. State what.
2. Copy the code into your IDE
3. Did you predict the output correctly?
4. If not, can you explain the misunderstanding?
```java
int x = 3;
System.out.println(x/2);
```
```java
int x = 3;
System.out.println("x/2");
```
```java
int x = (int)Math.random()*5;
System.out.println(x);
```
```java
int x = (int)(Math.random()*5);
System.out.println(x);
```
```java
int x = 3;
if(x == 3 || 4) {
System.out.println("Matches 3 or 4");
} else {
System.out.println("Other number");
}
}
```
```java
for (int i = 0; i < 10; i++); {
System.out.println(i);
}
```
```java
for (int i = 0; i > 10; i++) {
System.out.println(i);
}
```
```java
int x = 4;
if (x=3) {
System.out.println("Correct!");
}
```
```java
public class Main
{
Main()
{
System.out.println("Sausages");
}
public void shopping()
{
System.out.println("Eggs");
System.out.println("Potatoes");
System.out.println("Beans");
}
public static void main(String[] args)
{
}
}
```