Font size
WorksheetsC#
Total questions: 10
Worksheet time: 10mins
To inherit a class, the _______ notation is used in C#
:
;
=>
As
In a class the virtual function ____________
Can have a default implementation in the class
Must only be declared but not implemented
Cannot exist
An abstract class must have __________
Atleast one abstract method
Only virtual methods
Only static methods
_________ is an access modifier
Private
Params
Override
Out
An ____________ is an object that encapsulates information about an unusual program occurrence
Exception
try
catch
finally
Objects cannot be created for _________ class.
normal
student
abstract
struct
Static class can have _________ members.
static
abstract
static and non static
Void
What is lamda expression? (Any 2)
Anonymous function
Can be used to create delegates
Named function
None
Which of the following will be the correct output for the C#.NET code snippet given below?
String s1 = "Nagpur";
String s2;
s2 = s1.Insert(6, "Mumbai");
Console.WriteLine(s2);
NagpuMumbair
Nagpur Mumbai
Mumbai
NagpurMumbai
Usecase: A system needs to be implemented to create a mobile shop, consisting of Apple IPhone, OnePlus, Google Nexus. At run time, the end-user will provide the phone required and the system should be able to create an instance of the correct mobile phone object from his existing factory / godown / repository. Which design pattern fits this usecase?
Singleton
Abstract Factory
Adaptor
None
