I want to know that, We have a class called Point is present in namespace N1 as well as in namespace N2, then what is the correct way to use the Point class?
Using class in C#
Hi friends,
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Satyapriya NayakRank #47 · 31.5K reputationPosted Dec 3, 2011, 8:42 PM EST
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace N1
{
class Point
{
public void abc()
{
System.Console.WriteLine("Hello abc");
}
}
}
namespace N2
{
class Point
{
public void def()
{
System.Console.WriteLine("Hello def");
System.Console.ReadLine();
}
}
}
class Execute
{
public static void Main()
{
N1.Point a1 = new N1.Point();
a1.abc();
N2.Point a2 = new N2.Point();
a2.def();
}
}
Thanks
Sam HobbsRank #107 · 20.5K reputationPosted Dec 4, 2011, 12:20 PM EST
It is probably possible to have a "using" statement for one of the namespaces but not both of them and then you need to provide qualification for just one. That would work I think but in order to make the program easier for other programmers (and perhaps you in the future) to understand it would be better to use the full namespace names in situations where there are multiple possible qualifiers for the name.