Articles → .NET → Resolve Classes Conflict Using Global Namespace Qualifier In C#
Resolve Classes Conflict Using Global Namespace Qualifier In C#
namespace Global_NameSpace_Qualifier {
class Program {
static void Main(string[] args) {
Program.GetMessage();
}
}
}
public class Program {
public static string GetMessage() {
return "Hello";
}
}
Global Namespace Qualifier For Rescue
namespace Global_NameSpace_Qualifier {
class Program {
static void Main(string[] args) {
string messge = global::Program.GetMessage();
}
}
}
public class Program {
public static string GetMessage() {
return "Hello";
}
}