Question: ```
class switch1
{
    public static void main(String args[])
    {
        int a = 10;
        switch(a)
        {
            default: System.out.println("Default");
            case -1: System.out.println("-1");
        }
    }
}

```

I understand that this program will execute both "default" and "case -1" statements as break is not specified after the matching condition (in this case after "default").

But what I fail to understand is

a) why is `break` needed in a `switch` statement?

b) why does it even execute the invalid matching conditions' statements (i.e executing "case -1")) if all it does is matching?

Answer: 
`switch` statements without `break`s let you do things like this:

```
// Compute the most significant bit set in a number from 0 to 7
int topBit = -1;
switch(n) {
case 0:
    topBit = 0;
    break;
case 1:
    topBit = 1;
    break;
case 2:
case 3:
    topBit = 2;
    break;
case 4:
case 5:
case 6:
case 7:
    topBit = 3;
    break;
}

```

Essentially, it lets you create a set of labels, and have a condition at the top to let you jump to the initial label once. After that, the execution continues until a `break`, or reaching the end of the `switch`. This technique is old - it has been around since the assembly times, and by virtue of being included in C has made its way into Java and several other languages.
**In Switch case the point of interest is the break statement.** 

> 
> Each break statement terminates the enclosing switch statement.
>  Control flow continues with the first statement following the switch
>  block. The break statements are necessary because without them,
>  statements in switch blocks fall through: All statements after the
>  matching case label are executed in sequence, regardless of the
>  expression of subsequent case labels, until a break statement is
>  encountered.
> 
> 
> 

The program SwitchDemoFallThrough shows statements in a switch block that fall through. The program displays the month corresponding to the integer month and the months that follow in the year:

public class SwitchDemoFallThrough {

```
public static void main(String[] args) {
    java.util.ArrayList<String> futureMonths =
        new java.util.ArrayList<String>();

    int month = 8;

    switch (month) {
        case 1:  futureMonths.add("January");
        case 2:  futureMonths.add("February");
        case 3:  futureMonths.add("March");
        case 4:  futureMonths.add("April");
        case 5:  futureMonths.add("May");
        case 6:  futureMonths.add("June");
        case 7:  futureMonths.add("July");
        case 8:  futureMonths.add("August");
        case 9:  futureMonths.add("September");
        case 10: futureMonths.add("October");
        case 11: futureMonths.add("November");
        case 12: futureMonths.add("December");
                 break;
        default: break;
    }

    if (futureMonths.isEmpty()) {
        System.out.println("Invalid month number");
    } else {
        for (String monthName : futureMonths) {
           System.out.println(monthName);
        }
    }
}

```

}

This is the output from the code:

August
September
October
November
December

Technically, the final break is not required because flow falls out of the switch statement. Using a break is recommended so that modifying the code is easier and less error prone. The default section handles all values that are not explicitly handled by one of the case sections.

Look Here for complete information about [switch](http://docs.oracle.com/javase/tutorial/java/nutsandbolts/switch.html)