Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,12 @@
using System;
abstract class Printer
{
public abstract void Print();
}
class PrinterImpl : Printer
{
public override void Print() {
Console.WriteLine("Hello world!");
}
}

View file

@ -0,0 +1,22 @@
using System;
public delegate int IntFunction(int a, int b);
public class Program
{
public static int Add(int x, int y) {
return x + y;
}
public static int Multiply(int x, int y) {
return x * y;
}
public static void Main() {
IntFunction func = Add;
Console.WriteLine(func(2, 3)); //prints 5
func = Multiply;
Console.WriteLine(func(2, 3)); //prints 6
func += Add;
Console.WriteLine(func(2, 3)); //prints 5. Both functions are called, but only the last result is kept.
}
}

View file

@ -0,0 +1,20 @@
//file1.cs
public partial class Program
{
partial void Print();
}
//file2.cs
using System;
public partial class Program
{
partial void Print() {
Console.WriteLine("Hello world!");
}
static void Main() {
Program p = new Program();
p.Print(); //If the implementation above is not written, the compiler will remove this line.
}
}