Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Test equality
//Title of this code //Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public delegate bool comp<T>(T t); public delegate bool comp<T,V>(T t,V v); public class ByOne<T,V>:IEquatable<T> { public T t; public V v; public ByOne(T a,V b) { t=default(T); v=default(V); } public bool Equals(T tp) { if(this.Equals(tp)) return true; else return false; } public bool Equals(T tp,V vp) { if(tp.Equals(vp)) return true; else return false; } /* public bool Equals(V vp) { if(this.Equals(vp)) return true; else return false; }*/ } public class Program { public static void Main(string[] args) { Console.WriteLine("ByOne\n\n"); int me1=10; double me2=15.2; byte me3=10; float me4=6.1F; ByOne<int,double> bone=new ByOne<int,double>(me1,me2); ByOne<int,double> bone1=new ByOne<int,double>(me3,me2); ByOne<int,double> bone2=new ByOne<int,double>(me3,me4); Console.WriteLine(me1.Equals(me2)); Console.WriteLine(me1.Equals(me1)); Console.WriteLine(me2.Equals(me1)); Console.WriteLine("------------------"); Console.WriteLine(); } } }
run
|
edit
|
history
|
help
0
Hello World Program
Execution flow of static and normal constructor of base and derived class.
VB6 DateSerial to C#
linq jean by Fausto
SQL import
Hello World!
test
generic stack implementation
Print 2D Array
code exple