Csharp

  • November 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Csharp as PDF for free.

More details

  • Words: 938
  • Pages: 4
1)

Does C# support multiple-inheritance?

2)

a) yes b) No c)both What’s the top .NET class that everything is derived from? a) System b) System. Object c) Both D) none

3) What is boxing? a) Encapsulating an object in a value type. b) Encapsulating a copy of an object in a value type. c) Encapsulating a value type in an object. d) Encapsulating a copy of a value type in an object 4) What is a delegate? 1. 2. 3. 4.

A strongly typed function pointer. A light weight thread or process that can call a single method. A reference to an object in a different process. An inter-process message channel.

5) How does assembly versioning in .NET prevent DLL Hell? 1. The runtime checks to see that only one version of an assembly is on the machine at any one time. 2. .NET allows assemblies to specify the name AND the version of any assemblies they need to run. 3. The compiler offers compile time checking for backward compatibility. 4. It doesn’t. 6) In Object Oriented Programming, how would you describe encapsulation? 1. 2. 3. 4.

The conversion of one type of object to another. The runtime resolution of method calls. The exposition of data. The separation of interface and implementation

7) Find the wrong statement about structure 1, it’s a user defined value type 2, it can’t hold null value 3, it is similar to class and it can be extendable. 4, it is placed on stack memory area

8) Which is not a component of C L R? 1. Common type system 2. Common language specification 3. Base class libraries 4. Garbage collector 9) Match the following? 1. Thread start 2. Method info 3. Attribute usage 4. Stream write 1. 1-a, 2-b, 3-c, 4-d 2. 1-d, 2-a, 3-b, 4-c

a. system. Reflection b. system. Attribute c. system.Io d. system. Threading 2.1-c, 2-a, 3-b, 4-d 4.1-d, 2-c, 3-a, 4-b

10) Match the following 1. Virtual

a. method contains definition only

2. abstract

b. used to create an instance dynamically

3.

c. used to give new functionality for a method in derived class

new

4. Override 1. 1-a, 2-b, 3-c, 4-d 2. 1-d, 2-a, 3-b, 4-c

d. method can have functionality and can be extended 2.1-c, 2-a, 3-b, 4-d 4.1-d, 2-c, 3-a, 4-b

11) find the correct statement about value type 1. value types can hold null values 2. value types are placed on stack memory area 3. value types can be extendable 4. value type variables can be garbage collected 12) what is extension of strong name key file name 1. .dll 2. .snk 3. .exe 4. .cs 13) Find the wrong statement about operator overloading 1. the method should be static 2. the method should use operator keyword 3. the method can return void 4. For binary operator we must pass two arguments.

14)

15)

find the wrong statement about shared assemblies 1. it must have unique id before placing it on to gac 2. unique id must be registered to the assemblyinfo.cs file 3. it must placed on gac using gacutil.exe 4. it must be registered to OS in order to consume it from another application. match the following 1.method overloading 2.method overriding 3.new method 4.sealed method 1. 1-a, 2-b, 3-c, 4-d 2. 1-c, 2-b, 3-a, 4-d

a. method that cant be extended b. methods having same name with different signature c. methods having same name and signature d. hides the base class method 2.1-b, 2-c, 3-d, 4-a 4.1-d, 2-c, 3-a, 4-b

16) After compiling int will be converted to 1. System.int16

2.system.int32 3.system.int64 4.system.int128

17) By using Reflection concept we can read metadata (YES / NO) : 18) Attributes add metadata to an assembly (YES / NO): 19) To create user defined exception we need to extended either 1. System. Exception 2. system.applicatonexception 3. Both 4 none 20) which of the following option about implementing polymorphism is NOT true a)you can implement polymorphism by implementing an interface b) you can implement polymorphism by encapsulation c) you can implement polymorphism by using abstract classes d) you can also achieve polymorphism by inheritance. 21) consider the following statements Statement A: in dynamic polymorphism appropriate methods of a program can be invoked. Statement B : in early binding , function calls are bound at run time. a. b. c. d.

statement A is true and statement B is false. statement A is false and statement B is true. Both statements are true. Both statements are false

22) which of the following is true about abstract class a. b. c. d.

an abstract class defines properties common to the classes derived from it. An abstract class can be declared as final. Abstract class cannot be extended. Classes declared using the abstract keyword can be instatiated.

23) consider the following code. Interface a { Void b; } Class c { Void a.b() {} } Which of the following statement generates the compilation error in preceding code ? a) b) c) d)

interface a void b() void a.b() {} class c

24) consider the following statements : Statement A : named parameters are used to specify essential information of an attribute. Statement B : positional parameters are used to convey optional information in an attribute. a. statement A is true and statement B is false. b. statement A is false and statement B is true. c. Both statements are true. d. Both statements are false 25) match the following delegate concept with there implementation Delegate implementation 1. declare the delegate 2. instantiate the delegate 3. using delegate

syntax testdelegate var = new testdelegate(func); public delegate void testdelegate(string arg) testdelegate(“test”)

Related Documents

Csharp
June 2020 9
Csharp
November 2019 23
Csharp
November 2019 24
Csharp
November 2019 15
Adonet Csharp
December 2019 13
Tutorial Csharp
October 2019 13