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:
expression
Is a:
Definition
Applies to Version:
C# 1.0 and later
Namespace:
N/A
Assembly:
N/A (N/A)
Description:
An
expression
is any
block
of code that can
return
an
object
value. Typically, an
expression
return
s a
bool
ean value (
as
in an
if-else
statement
). The value derived from an
expression
must be evaluated. In other words, you can't place a
block
of code inside of surrounding parenthesis all by itself - you'll get an error if you
do
.
Example(s):
if (true) // returns a bool value MessageBox.Show("It's TRUE!"); // this is executed else MessageBox.Show("It's FALSE!"); MessageBox.Show((1 == 1).ToString()); // this will print "True"; MessageBox.Show((1 != 1).ToString()); // this will print "False"; int i = 1; switch (i) // returns an int value { case 1: MessageBox.Show("It's 1."); break; case 2: MessageBox.Show("It's 2."); break; } bool bln = true; String s = ("Hello " + bln.ToString() + " World!").ToUpper(); // returns a string value MessageBox.Show(s); // prints "HELLO TRUE WORLD!";
COPYRIGHT/DISCLAIMER
|
CONTACT US