C# practice programs

C# class and constructor – programs for practice

Q) What is output of C# code? Output:Base class constructorChild class constructorExplanation: In inheritance C# oops relationship, when we create object of a derived or child class then first base class constructor then derived class constructor get called. Q) What is output of below C# code example? Output: Compiler error – constructor re-definition Compiler error […]

C# Interface – Programs for Practice

Q) What is output of C# code? Output:Saving AccountProcess saving accountExplanation: Saving Account class inherits an interface and implement its methods in the class. Note that if a class inherits an interface in C# programming, then class must implement all the methods and properties of interface or interfaces if we inherit multiple interfaces. You can […]

Scroll to top