W
Wiktor Zychla
Why it is not allowed to have a methods and the properties with the same
name in a class?
For example I would like to be able to have
using System;
class C
{
int A( int p ) { return p*2; }
int A { get { return 5; } }
public static void Main() {}
}
One could argue that I can declare a method with an empty parameter list but
what I would like to know is why it could not work as shown above?
Regards
Wiktor Zychla
name in a class?
For example I would like to be able to have
using System;
class C
{
int A( int p ) { return p*2; }
int A { get { return 5; } }
public static void Main() {}
}
One could argue that I can declare a method with an empty parameter list but
what I would like to know is why it could not work as shown above?
Regards
Wiktor Zychla