C#
Please just annswer all questions. if you going to answer 1 or 2 questions only please don't answer any. Thank you
1) To make it easy to test a class library, you can:
a. Make sure that all of the classes require only
the System namespace
b. Put references to all of the .NET namespaces in the
library
c. Add one class to the library at a time
d. Develop the class library project within a solution
that contains a Windows Forms project
2) What is the difference between ref and out keywords? (4 Points)
3) What is the difference between Interface and Abstract Class?
Initially you go to file-new project and if you choose to test your project using console Application you need to choose Visual C#->Windows->Console application as your application type. you can choose any name for your project .In case you are working on a class library called formula evaluator just name your console application as Formula evaluatot test. you must assure that it reside in the same place where your Class library project is.now it open as program.cs file and to ensure that new project is linked with Class library you need to right click on the console and choose Add-refrence and then go to projects-solution in left pane and check the checkbox of your class library and then choose by right click on console -set as startup project and after clicking start button your console application will run.
Hence the correct option is d.
2.Characteristics of Ref keyword:
a) Initializatin of the parametrs is must before they pass to ref
b)Initialization is absolutely unnecessary before returning it to the calling method
c)if the called method also has to change the value of the passed parameter then passing the value through ref keyword is extremely useful
d) flow of data is bidirectional
Characteristics of Out keyword
a)Initialisation of the parameters is not must before they pass to out
b)Initialization is necessary before returnin g it to the calling method
c)It is useful to declare parameter through out if method returns multiple values
d) flow of data is unidirectional
3)Abstract class contains different type of modifiers like public,private,protected.performance is fast,a class can use only one abstract class On the contrary interface contain only public modifiers,performance is slow,A class can use multiple interface
Get Answers For Free
Most questions answered within 1 hours.