Question: I created a setup by Advanced Installer software for my program that I've written by c#. I installed my program on VMWare Windows7.

When I try to run it this message is displayed:

![Class not registered](https://i.stack.imgur.com/efAyh.png)

Answer: 
It would be a good idea to add a default case to your switch statement.

Example:

```
switch (monthNumber) {
    case 1: monthString = "January";
        break;

    //other cases...

    default: monthString = "Invalid Month Number";
        break;
}

```

This way if `monthNumber` is not 1-12 then there is still a default case for the switch statement to flow to.
Local variables MUST always be initialized before use.
For Java 6, the compiler doesn't consider the **"Incomplete"** initialization of variables within flow control blocks and try-catch blocks. The initialization must be done for all cases:

**If - else**:

```
String s;
int a = 10;
if(a > 5){
 s = "5";
}else{
 System.out.println("");
}    
System.out.println(s); // error if s isn't initialized within both if and else blocks

```

**While loop**:

```
String s;
int a = 10;
while(a > 0) {
  s= ">0";
  a--;
}    
System.out.println(s);// error if s isn't initialized outside the while

```

**Try-Catch block**:

```
String s;
try {
 s = "";
    } catch (Exception e) {}
System.out.println(s);// error if s isn't initialized within both try and catch blocks

```

**Switch block**:

```
String s;
int a = 10;
switch (a) {
     case 10: 
         s="10";
         break;
     default:
         break;
         }
System.out.println(s);// error if s isn't initialized all cases, default case included

```

Initialize the variable before the switch and all will be fine.

```
String monthString = "";

```