Method declaration must begin with the keyword partial and the method
should return void.
2. Methods can have ref parameters, but not out parameters.
3. Methods cannot be virtual, as they are private implicitly.
4. Partial methods cannot be extern as the presence of a body determines
whether they are defining or implementing.
5. We cannot make a delegate to a partial method.
Overview
[ 14 ]
Implicitly Typed Local Variables
Implicitly typing variables is a new feature that makes your job easier. The compiler
takes care of identifying the type of variables from the value used for initializing the
variables. LINQ also make use of this new feature for identifying the type of data
that results from the LINQ queries. The programmer need not specify the return
type of the querie's result. We normally declare variables by specifying the type of
the variable. For example, to declare variables of type integer, string, and array of
integers we would be writing it as:
int iCount = 0;
string sName = "Hi";
int[] iIntegers = new int[] {1,2,3,4,5,6,7,8,9};
The equivalent of the above declarations using implicit typing would be as follows:
var iCount = 0;
var sName = "Hi";
var iIntegers = new int[] {1,2,3,4,5,6,7,8,9};
We have used the keyword var and a value for initializing the variable.
Pages:
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37