Question: In the below C# program, write classes Kait and John to have the output result described in the output window. Write codes of both classes
In the below C# program, write classes Kait and John to have the output result described in the output window. Write codes of both classes (Kait & John) in the answer section.
|
class imposter { public virtual void PrintString() { Console.WriteLine(Here is the list of imposters.); } }
//Need to write Kait class
//Need to write John class
class Program { static void Main(string[] args) { Imposter imposter = new imposter(); imposter.PrintString(); Console.WriteLine(First imposter:); imposter = new Kait(); imposter.PrintString(); Console.WriteLine(Second imposter:); imposter = new John(); imposter.PrintString(); } }
|
Output Window
|
imposter is the list of imposters. First imposter: I am Kait! Second imposter: I am John! |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
