answersLogoWhite

0


Best Answer

A fall through is a switch with a case that will "fall" or continue on to another case if chosen. This is done by excluding the break from the case, however a break must ultimately be reached or there will be errors, and or infinite loops.

This is an example of a switch with a fall through:

int n = 1;

switch(n)

{

case 1:

Console.WriteLine("In case 1.");

case 2:

Console.WriteLine("In case 2.");

break;

}

In this switch case 1 will be executed and since there is no break, it will fall through to case 2.

Language was not specified, so this is written in c#, as it's what I use most often.

You can generally find very detailed information on any language using a search engine. For example, search "[insert programming language] switch case".

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is falll through in swith case?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions