What happens when we remove a break from a switch statement in CSharp?

Опубликовано: 15 Октябрь 2024
на канале: Dev Leader
12
1

What happens when we remove a break from a switch statement in CSharp?

The whole program implodes. That's it. The end.

Well, only if you did this by accident and ran into an exception! But this does have very valid use cases as well!

We can remove a break or a return keyword from a case in a switch statement, and it will allow the logic to flow forward.

Check out the full video:
   • CSharp Switch Statements - How To Con...  

----
📨 Sign up for my FREE email newsletter:
https://subscribe.devleader.ca
🗣️ Share with your network!

#csharp #dotnet #dotnetcore #csharpdevelopers