If A Class Named Csharp Is Present In Namespace N1 As Well As #763
If a class named csharp is present in namespace n1 as well as in namespace n2, then which of the following is the correct way to use csharp class?
This multiple choice question (MCQ) is related to the book/course gs gs108 CSharp. It can also be found in gs gs108 Namespaces, Preprocessors and Networking - Fundamentals of Namespaces - Quiz No.1.
If a class named csharp is present in namespace n1 as well as in namespace n2, then which of the following is the correct way to use csharp class?
class Program { static void Main(string[] args) { import n1; csharp x = new csharp(); x.fun(); import n2; csharp y = new csharp(); y.fun(); } }
import n1; import n2; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { n1.csharp x = new n1.csharp(); x.fun(); import n2; n2.csharp y = new n2.csharp(); y.fun(); } } }
class Program { static void Main(string[] args) { using n1; csharp x = new csharp(); x.fun(); using n2; csharp y = new csharp(); y.fun(); } }
using n1; using n2; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { n1.csharp x = new n1.csharp(); x.fun(); import n2; n2.csharp y = new n2.csharp(); y.fun(); } } }