Use of Break statement in switch statement
Explain the function of break statement in a switch statement with example?
Expert
Switch statement is the selection control statement which is used to handle several choices and move control to a case statements within its body.
Following code shows the example of the use of a switch statement in C#:
switch(choice)
{
case 1:
console.WriteLine("First");
break;
case 2:
console.WriteLine("Second");
default:
console.WriteLine("Wrong choice");
}
The break statement is used at the end of the case statement. Break statement is compulsory in C# and it avoids the fall through of one case statement to other.
How all items in the CheckedListBox control in .NET 4.0 can be checked/unchecked?
Which method is used in .NET to enforce garbage collection?
Is it possible to validate a DropDownList by RequiredFieldValidator?
Briefly explain about PLINQ?
How a color is picked from the ColorDialog box?
What is meant by the XML DOM?
Explain how to store and retrieve images in the SQL server database via VB.NET?
How to make a windows desktop application using visual studio 2010 ultimate?
Define .NET Framework?
How a condition can be implemented in the workflow?
18,76,764
1939633 Asked
3,689
Active Tutors
1425460
Questions Answered
Start Excelling in your courses, Ask an Expert and get answers for your homework and assignments!!