C#.NET — which are the correct ways to call method Issue() from Book and Journal classes in College.Lib namespace?
C# Programming
Namespaces
Difficulty: Medium
Choose an option
-
ACollege.Lib.Book b = new College.Lib.Book(); b.Issue();
-
BBook b = new Book(); b.Issue();
-
Cusing College.Lib; Book b = new Book(); b.Issue();
-
Dusing College; Lib.Book b = new Lib.Book(); b.Issue();
-
Eusing College.Lib.Book; Book b = new Book(); b.Issue();
Answer
Correct Answer: using College.Lib; Book b = new Book(); b.Issue();
Explanation
Fact:To avoid writing fully qualified names repeatedly, we can use using College.Lib;. This allows direct instantiation of Book and Journal.
Final Answer:using College.Lib; Book b = new Book(); b.Issue();