Question: In C# Language Understand the code below and answer the following questions. In your answer, specify the question that you are answering: A. Change A

In C# LanguageIn C# Language Understand the code below and answer the following questions.In your answer, specify the question that you are answering: A. Change

Understand the code below and answer the following questions. In your answer, specify the question that you are answering: A. Change A in such a way that only the inherited classes of A can access the method Walko. All other classes should not be able to access Walko B. If you think the class C can override the method Print, then change B in such a way that prevents from overriding the method Printo. C. Write the output of the following statement CC= new CO: D. Make classes A, B, and C trackable classes by implementing the interface Trackable. Remember, the method ObjectsCreatedSo Far throws a user-defined exception which means you need to create that exception. Moreover, to implement this method, you need to modify the classes A, B, and C. E. Create a method that takes an array of Trackable objects, iterate over them, and prints the objectsCreated So Far on each object. If an object throws an exception, print a nice message and continue to the next object in the loop. Handle all corner cases and if there is any expected exception, handle it properly using exception handling technique. Avoid general exception handling. public class A { O references public A() { Console.WriteLine("I am A"); } O references public void Walk() { Console.WriteLine("A is walking"); } 1 reference public virtual void Print() { Console.WriteLine("Print A"); } } 2 references public class B : A { O references public BC) { Console.WriteLine("I am B"); } 1 reference public override void Print() { Console.WriteLine("Print B"); } } public class C : B { O references public C) { Console.WriteLine("I am C"); } } 1 reference O references public interface Trackable { O references public string ObjectsCreatedSoFar(); /* This method returns the number of objects instantiated from this class. * If no objects created so far, it throws a user-defined Exception named NoobjectCreatedException */ }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!