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";
  }
}





Posted By  -  Karan Gupta
 
Posted On  -  Friday, June 19, 2015

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250