Question: In java if I have initialized a variable in a function that returns an that variable at the end, why can't I return that function?

Here's the some sample code, that I was working

```
  private int spitNumber(int imgNum) {
      int returnNum;
      switch (imgNum) {
      case 1:
      case 14:
      case 27:
      case 40:
      returnNum = 1;
      break;

      case 12:
      case 25:
      case 38:
      case 51:
      returnNum = 12;
      break;

      case 13:
      case 26:
      case 39:
      case 52:
      returnNum = 13;
      break;

    };
    return returnNum;
  }

```

When I compile the code I get the error message

```
error: variable returnNum might not have been initialized
    return returnNum;
           ^

```

Answer: 
You're using `switch` but your switch does not cover all the cases.

Think when `imgNum = 100`, what value will your program assign to `returnNum`?

Nothing, right?

So you should initialize a starting value for `returnNum` or provide a `default` case for `switch` and assign your `returnNum` value there
Primitive types like `int`, for example, cannot be `null`. You must initialize it.