Current .Net Version: 1.1.4322
(select below)
.Net Framework
ASP.NET/Web Forms
C#
SQL Server
Visual C#
Windows Forms
XML Web Services
C# Reference
List:
Access Keyword
Access Modifier Keyword
Attribute
Conversion Keyword
Definition
Literal Keyword
Method Parameter Keyword
Modifier Keyword
Namespace Keyword
Operator
Operator Keyword
Preprocessor Directive
Statement Keyword
Type
Type Keyword
Search:
block
Is a:
Definition
Applies to Version:
C# 1.0 and later
Namespace:
N/A
Assembly:
N/A (N/A)
Description:
Any
block
of code surrounded by left and right brackets. Any variables defined within a code
block
are only accessible with the
block
and not from any parent
block
s beneath it. However, any variables defined within a parent code
block
is accessible from the nested
block
.
Syntax:
{
statement
} or ... { /* parent
block
*/ { /* nested
block
*/ } }
Example(s):
// Code block by itself - although wierd, very valid syntax: { String strMyString = "Hello!"; } // We won't be able to use strMyString from outside of its // code block! Oh well! // try-catch code blocks try { // try code block... } catch { // catch code block... }
COPYRIGHT/DISCLAIMER
|
CONTACT US