explain and give the output { using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace InterfaceDemo {
Fantastic news! We've Found the answer you've been seeking!
Question:
explain and give the output
Transcribed Image Text:
{ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace InterfaceDemo { } { } public interface IFirst { void FirstMethod(); } public interface ISecond { void SecondMethod(); } public class First: IFirst //implement interface public void FirstMethod() { Console.WriteLine("First"); } public class Second: ISecond //implement interface public void SecondMethod() { Console.WriteLine("Second"); } public class FirstAndSecond: IFirst, ISecond //implement interface { } First first = new First(); Second second = new Second(); public void FirstMethod() { first.FirstMethod(); } public void SecondMethod() { second.SecondMethod(); } class Program { static void Main(string[] args) { FirstAndSecond fAndS = new FirstAndSecond(); fAndS.FirstMethod(); fAndS.SecondMethod(); Console.ReadKey(); } } { using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace InterfaceDemo { } { } public interface IFirst { void FirstMethod(); } public interface ISecond { void SecondMethod(); } public class First: IFirst //implement interface public void FirstMethod() { Console.WriteLine("First"); } public class Second: ISecond //implement interface public void SecondMethod() { Console.WriteLine("Second"); } public class FirstAndSecond: IFirst, ISecond //implement interface { } First first = new First(); Second second = new Second(); public void FirstMethod() { first.FirstMethod(); } public void SecondMethod() { second.SecondMethod(); } class Program { static void Main(string[] args) { FirstAndSecond fAndS = new FirstAndSecond(); fAndS.FirstMethod(); fAndS.SecondMethod(); Console.ReadKey(); } }
Expert Answer:
Answer rating: 100% (QA)
The provided code demonstrates the use of interfaces in C It defines three interfaces IFirst ISecond ... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
"internet radios" for streaming audio, and personal video recorders and players. Describe design and evaluation processes that could be used by a start-up company to improve the usability of such...
-
Python and most Python libraries are free to download or use, though many users use Python through a paid service. Paid services help IT organizations manage the risks associated with the use of...
-
Name the five levels of the Capability Maturity Model.
-
Selected comparative financial statement data for Kigio Inc. are shown below. Additional information (in thousands)201820172016 Allowance for doubtful accounts...................$...
-
Tom would like 3 pints of home brew today and an additional 4 pints of home brew tomorrow. Dick is willing to sell a maximum of 5 pints total at a price of $3.00 per pint today and $2.70 per pint...
-
What are some of the nonverbal clues to deception?
-
The following monthly data are taken from Ramirez Company at July 31: Sales salaries, $300,000; Office salaries, $60,000; Federal income taxes withheld, $90,000; State income taxes withheld, $20,000;...
-
Knowing the specific heat of ice and water is 2.05KJ/kg o C and 4.18kJ/kgC. What is the heat needed to change 2kg of ice at -20 C into 100 C water?
-
Healthwise Medical Supplies Company is located at 2400 Second Street, City, ST 12345. The company is a general partnership that uses the calendar year and accrual basis for both book and tax...
-
WXYZ is a kite. Find the measure of angle W. F 160 G 95 H 200 J 100 W X 85 75% Z
-
A common method of prioritizing stakeholders is based on the stakeholders: a. legitimacy b. power c. urgency d. all of the above
-
A potential client wants you to be project manager for the construction of a new house, but they are vague about the details. List a few questions you could ask them to gain a better understanding of...
-
Give an example of a leading indicator and a lagging indicator from a project or type of project you are familiar with.
-
What is used to compare actual project spending with planned expenditures to determine if corrective action is needed?
-
Consider a project (professional, personal, or educational) that you worked on in the past. Which project management conceptsif anydid you apply? How did they foster success? If you did not apply...
-
(a) Calculate the pressure exerted by one mole of carbon dioxide exerts that occupies a volume of 4.5 L at 303.15 K using the virial equation. The second virial coefficient B is equal to -118 cm/mol....
-
Determine which of the following limits exist. Compute the limits that exist. lim x-0 1- + 3x X
-
Youve seen how to create mutual class friends. Can you create a more restricted form of friendship in which only some members of Class B are friends to Class A and some members of A are friends to B?...
-
Revise the baseDMA-lacksDMA-hasDMA class hierarchy so that all three classes are derived from an ABC. Test the result with a program similar to the one in Listing 13.10. That is, it should feature an...
-
Write a program using nested loops that asks the user to enter a value for the number of rows to display. It should then display that many rows of asterisks, with one asterisk in the first row, two...
-
Volunteer work can improve your skills and enhance your rsum. With a partner, seek volunteer opportunities on your campus or in your city. Make a list of volunteer groups that may need help. Here are...
-
What are six brainstorming questions to consider before starting your proposal?
-
What is the difference between a competitive and noncompetitive proposal?
Study smarter with the SolutionInn App