/* Right, Wrong */
using System;
/*
public int Increment(int i){
return i + 1;
}
public void Main (){
int i = 5,
j = Increment(i);
Console.WriteLine("i and j: {0}, {1}", i, j);
} // end Main
*/
public class FunctionDemo {
public static void Main (){
SimpleFunction();
}
public static void SimpleFunction(){
int i = 5,
j = Increment(i);
Console.WriteLine("i and j: {0}, {1}", i, j);
}
public static int Increment(int i){
return i + 1;
}
} | |
Functions are not allowed here.
A namespace can only contain types
and namespace declarations.
A simple function which calls increment.
|