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.
Is it possible to declare a private class in a namespace?
Specify advantages of the XML schemas over DTD.
Explain the code-behind feature of ASP.NET?
List out the difference between the “dynamic” and “var” data types?
Name the different methods provided by a DataSet object to create XML?
Why do we require the nested master pages in the Web site?
Explain the difference between the Response.Output.Write() and Response.Write() methods?
What is meant by the term Global Assembly Cache (GAC)?
Explain the difference between the global theme and the page theme?
Illustrate the difference between System.Windows.dll and System.Windows.Browser.dll?
18,76,764
1948682 Asked
3,689
Active Tutors
1421750
Questions Answered
Start Excelling in your courses, Ask an Expert and get answers for your homework and assignments!!