(Object Obj1, Object Obj2) " Defines: A

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 9

1.

The declaration “ public delegate void SimpleDelegate () “


defines :
a. This declaration defines a delegate named SimpleDelegate,
which will not encapsulate any method and returns no value.
b. This declaration defines a delegate named SimpleDelegate,
which will encapsulate any method that takes no parameters
and returns no value.
c. This declaration defines a delegate named SimpleDelegate,
which will encapsulate a single method that takes all the
parameters and returns no value.
d. This declaration defines a delegate named SimpleDelegate,
which will encapsulate any method that takes all the
parameters and returns an Integer value.
Ans : b
2. The declaration “public delegate int ButtonClickHandler
(object obj1, object obj2)” defines :
a. This declaration defines a delegate named ButtonClickHandler,
which will encapsulate any method that takes two objects as
parameters and not returns an int.
b. This declaration defines a delegate named ButtonClickHandler,
which will encapsulate any method that takes two or more
objects as parameters and returns no value.
c. This declaration defines a delegate named ButtonClickHandler,
which will not encapsulate any method that takes two objects as
parameters and returns no value.
d. This declaration defines a delegate named ButtonClickHandler,
which will encapsulate any method that takes two objects as
parameters and returns an int.
Ans : d
3. Which one of the following is not used in Defining and using
Delegates:
a. Declaration
b. Subsciption
c. Instantiation
d. Invocation
Ans: b
4. In the declaration “delegate result-type identifier
([parameters]);”, the identifier defines
a. The name of the method encapsulated in the delegate.
b. The return type of the function.
c. The name of the Delegate.
d. The input type of the parameters.
Ans: c

5. Multicasting in Delegates is defined as


a. Pointing to a single function repeatedly .
b. Pointing to more than one function at a time.
c. Pointing to many functions one at a time.
d. Cascading all the similar functions.
Ans: b
6. Which one of the following does not belong to Interface
a. Methods
b. Properties
c. Indexers
d. Constructors
Ans: d
7. By default, how many threads does a c# program has
a. None
b. One
c. Two
d. Three
Ans: b
8. Thread.Resume can be used on
a. Blocked Thread
b. Suspended Thread
c. Both the Threads
d. Not related to these.
Ans: b
9. A Thread can be aborted in which of the following states
a. Running state
b. Blocked state
c. Suspended state
d. All of the above states
Ans : d
10.The Process of keeping the Data and methods together inside the
objects is called
a. Polymorphism
b. Inheritance
c. Abstraction
d. Encapsulation
Ans: d
11.The process of creating new classes from already existing classes is
called
a. Polymorphism
b. Inheritance
c. Abstraction
d. Encapsulation
Ans: b
12. The process of separation of object interactions from classes and
inheritance into distinct layers of abstraction is called
a. Encapsulation
b. Polymorphism
c. Decoupling
d. Abstraction
Ans: c
13. The process through which an object’s state is transformed into
some data format in order to store for later use is called
a. Serialization
b. Deserialization
c. Abstraction
d. Decoupling
Ans: a
14. XML Serialization can serialize
a. Private members
b. Public members
c. Both Public & Private members
d. Any members
Ans: b
15. Assemblies placed in Global Assembly Cache must have
a. Same Assembly name and File name with .exe extension only
b. Same Assembly name and File name with .dll extension only
c. Same Assembly name and File name with either .exe or .dll
extensions.
d. Not necessarily same Assembly name and File name.
Ans: c
16. The PublicKeyToken is not required in the <assemblyIdentity>
element of the assembly manifest of
a. Private Assembly
b. Shared Assembly
Ans: a
17. Delay Signing refers to the technique of partially signing
assemblies using Public Key/ Private Key while they are in
a. Deployment Phase
b. Development phase
c. Shared Phase
d. GAC
Ans: b
18. The process of providing different versions of a method that have
the same name but accepting parameters with different data types is
called
a. Overriding
b. Overloading
c. Shadowing
d. Polymorphism
Ans: b
19. The Process of replacing the base class with the derived class but
accepting same data types and number of arguments is called
a. Overriding
b. Overloading
c. Shadowing
d. Polymorphism
Ans: a
20. The Process of creating a new version of a method and hiding the
original version of the method from the user is called
a. Overriding
b. Overloading
c. Shadowing
d. Polymorphism
Ans: c
21. The Conversion of Value type to Reference type is known as
a. Unboxing
b. Boxing
c. Type Conversion
d. Value Conversion
Ans: b
22. The Conversion of Reference type to Value type is known as
a. Unboxing
b. Boxing
c. Type Conversion
d. Reference Conversion
Ans: a
23. All the value types in Boxing are stored in a
a. Stack
b. Heap
c. Table
d. Array
Ans: a
24. All the Reference types in Unboxing are stored in a
a. Stack
b. Heap
c. Table
d. Array
Ans: b
25. Inheritance can be applied for Structures

a. True
b. False

Ans: b
26. What is the result of the code below
struct MyStruct
{
int x = 20;
int y = 20;
}
Console.WriteLine("The sum is", x+y);
a. 40
b. 0
c. Throws an error message
d. Returns garbage value

Ans : c( Its not possible to initialize a value inside a structure)

27. Which of the following is not an access modifier


a. Public
b. Internal
c. External
d. Protected

Ans: c
28. A Virtual Modifier is used to declare a method whose implementation can
be changed in a derived class by
a. Overloading Member
b. Overriding Member
c. Shadowing Member
d. Cannot be changed

Ans: b
29. The technique of accessing the metadata of the assemblies is called
a. Shadowing
b. Reflection
c. Refraction
d. Repitition

Ans: b
30. The Assemblies which contain only culture information which are used to
get language specific resources for an application are called
a. Private assemblies
b. Shared assemblies
c. Satellite assemblies
d. Global assemblies

Ans: c
31. Private assembly must have a strong name to get identified.
a. True
b. False

Ans: b
32. What is the result of the below code
Byte value1=10;
Byte value2=23;
Byte total;
Total = value1+value2;
Console.Writeline(Total);
a. 33
b. 0
c. Throws an error message
d. Garbage value

Ans: c (Cannot implicitly convert type ‘int’ to ‘byte’ )


33. The below code is an example of
Int I = 20;
Object o = I;
a. Unboxing
b. Boxing
c. Shadowing
d. Invocation

Ans: b
34. Which of the following method locates the first occurrence of a given
substring or character in the string
a. Compare
b. CompareOrdinal
c. IndexOf
d. Substring

Ans: c
35. Shared assembly is found either in the same directory as the application,
or within one of its subdirectories.
a. True
b. False

Ans: b

36. The Strong Name of the Shared assembly does not contain

a. Name of the Assembly


b. Version Number
c. Type of the Assembly
d. Culture

Ans: c
37. The Syntax for creating a Strong Name is
a. sn -k mykey.snk
b. sn k mykey.sn
c. sn mykey –k.snk
d. sn mykey.snk –k
Ans: a

38. Delay Signing is related to


a. Delegates
b. Assemblies
c. Interfaces
d. Events

Ans: b
39. Publisher Policy files are applied to
a. Private Assemblies
b. Delegates
c. Interfaces
d. Shared Assemblies

Ans: d
40. The ability to read, write, create or delete registry keys and values is
controlled by which of the following policies
a. SecurityPermission
b. RegistryPermission
c. DnsPermission
d. DirectoryServicesPermission

Ans : b
41. Which of the following access modifiers can be accessed by any code in the
same assembly , but not from another assembly
a. Protected Internal
b. Private
c. Protected
d. Internal

Ans: d
42. Which of the following access modifiers can be accessed by any code in the
same assembly , or by any derived class in another assembly
a. Protected Internal
b. Private
c. Protected
d. Internal
Ans : a

You might also like