Quote:
For example:
Class SomeClass {
//Some properties defined
//Method follows as
void method1 (SomeClass var1, int var2) {
//set of statements to be executed
}}
Here in question, I am referring to the type of parameter passed in the method of class which is of same type as of class itself.
This is possible (albeit is not what you asked in question title), for instance
interface IMyInterface
{
void report(IMyInterface mi);
int id
{
get;
}
}
class MyClass : IMyInterface
{
int _id;
public MyClass(int i) { _id = i; }
public void report(IMyInterface mi)
{
Console.WriteLine("{0}", mi.id);
}
public int id
{
get { return _id; }
}
}
class Program
{
static void Main()
{
MyClass a = new MyClass(5);
MyClass b = new MyClass(-1);
b.report(a);
}
}