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
  • A
    College.Lib.Book b = new College.Lib.Book(); b.Issue();
  • B
    Book b = new Book(); b.Issue();
  • C
    using College.Lib; Book b = new Book(); b.Issue();
  • D
    using College; Lib.Book b = new Lib.Book(); b.Issue();
  • E
    using 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();

Discussion & Comments
No comments yet. Be the first to comment!
Join Discussion