Sei sulla pagina 1di 5

What is a IL? Twist: - What is MSIL or CIL, What is JIT?

(IL)Intermediate Language is also known as MSIL (Microsoft Intermediate Language) or CIL (Common Intermediate Language). All .NET source code is compiled to IL. This IL is then converted to machine code at the point where the software is installed, or at run-time by a Just-In-Time (JIT) compiler. (B)What is a CLR? Full form of CLR is Common Language Runtime and it forms the heart of the .NET framework. All Languages have runtime and its the responsibility of the runtime to take care of the code execution of the program. What is a CLS (Common Language Specification)? This is a subset of the CTS which all .NET languages are expected to support. CLS is nothing but guidelines that language to follow so that it can communicate with other .NET languages in a seamless manner. What is a Managed Code? Managed code runs inside the environment of CLR i.e. .NET runtime. In short all IL are managed code. But if you are using some third party software example VB6 or VC++ component they are unmanaged code as .NET runtime (CLR) does not have control over the source code execution of the language. What is a Assembly? Assembly is unit of deployment like EXE or a DLL. What are different types of Assembly? There are two types of assemblies, Private and Public assembly. A private assembly is normally used by a single application, and is stored in the application's directory, or a sub-directory beneath. A shared assembly is normally stored in the global assembly cache, which is a repository of assemblies maintained by the .NET runtime. (What is GAC? Twist: - What are situations when you register .NET assembly in GAC? GAC (Global Assembly Cache) is used where shared .NET assembly reside.GAC is used in the following situations: If the application has to be shared among several application. If the assembly has some special security requirements like only administrators can remove the assembly. If the assembly is private then a simple delete of assembly the assembly file will remove the assembly. What is a garbage collector? A garbage collector performs periodic checks on the managed heap to identify objects that are no longer required by the program and removes them from memory.

Name the OOPS Concepts 1. Classes and Objects 2. Encapsulation 3. Abstraction 4. Inheritance 5. Polymorphism What is a class and object? A class is a conceptual representation of all the entities that share common attributes and behaviors. It defines the attributes and behaviors that are used by all the instances of that class. An object is an instance of a class. All the objects of a class have individual copies of the attributes and share a common set of behaviors. What is Data abstraction and Encapsulation? Abstraction refers to the act of representing essential features without including the background details or explanations. Classes use the concept of abstraction and are defined as a list of abstract attributes. Storing data and functions in a single unit (class) is encapsulation. Data cannot be accessible to the outside world and only those functions which are stored in the class can access it. What is Inheritance? Inheritance is the process by which objects can acquire the properties of objects of other class. In OOP, inheritance provides reusability, like, adding additional features to an existing class without modifying it. This is achieved by deriving a new class from the existing one. The new class will have combined features of both the classes. What is Polymorphism? Polymorphism means the ability to take more than one form. An operation may exhibit different behaviors in different instances. The behavior depends on the data types used in the operation. Polymorphism is extensively used in implementing Inheritance. What are the advantages of OOP? Object-Oriented Programming has the following advantages over conventional approaches: 1. OOP provides a clear modular structure for programs which makes it good for defining abstract data types where implementation details are hidden and the unit has a clearly defined interface. 2. OOP makes it easy to maintain and modify existing code as new objects can be created with small differences to existing ones. 3. OOP provides a good framework for code libraries where supplied software components can be easily adapted and modified by the programmer. This is particularly useful for developing graphical user interfaces.

What are the differences between class and structure? S.No 1 2 Structure Value Type Use stack allocation Structure members are public by default Must have at least one non shared variable. Structure members cannot be declared as protected Structures are not heritable Does not require a constructor Can have non shared constructors with parameters only Structures are never terminated, so the CLR never calls the Finalize method on any structure Implicitly inherit from Value Type and cannot inherit from any other type. Class Reference Type Use heap allocation Class variables and constants are private by default. Class members are public by default. Can be empty Class members can be declared as protected Classes are heritable Require a constructor Can have non shared constructors with or without parameters. Classes are terminated by Garbage Collector which calls Finalize method on a class when it finds no active references to it. Classes can inherit from any class or classes other than Value Type

3 4 5 6 7 8

10

What is a sealed class? A sealed class is a class that does not allow inheritance. Some object model designs need to allow the creation of new instances but not inheritance, if this is the case, the class should be declared as sealed. What is a multiple inheritance and can be achieved in .NET? Multiple inheritance is the possibility that a child class can have multiple parents. In OOP, multiple inheritance might become difficult to handle because it allows ambiguity for the compiler. Java and the .NET Framework languages do not allow multiple inheritance. Multiple inheritance can be emulated in .NET using Multiple Interface Inheritance, which I will explain in Part 3 of this series. Virtual keyword The virtual keyword allows polymorphism too. A virtual property or method has an implementation in the base class, and can be overridden in the derived classes. Override keyword Overriding is the action of modifying or replacing the implementation of the parent class with a new one. Parent classes with virtual or abstract members allow derived classes to override them.

What is an interface? An interface contains only the signatures of methods, delegates or events. The implementation of the methods is done in the class that implements the interface What is an abstract class? The abstract modifier can be used with classes, methods, properties, indexers, and events. Use the abstract modifier in a class declaration to indicate that a class is intended only to be a base class of other classes. Abstract classes have the following features: An abstract class cannot be instantiated. An abstract class may contain abstract methods and accessors. An abstract class cannot be inherited. A non-abstract class derived from an abstract class must include actual implementations of all inherited abstract methods and accessors. What is the difference between Abstract class and an interface? 1. Abstract Class may contain constructor but interface does not contain constructor. 2. By default, all variables in interfaces are static and final, and then we can't declare method as final. 3. In Interface all methods should be public but not in abstract class. 4. Interface supports multiple inheritances but abstract class does not support. 5. We should initialize variables in interface but not necessary in abstract class. How do you call and execute a stored procedure in .NET? 1. Set the stored procedure name to the command objects CommandText property 2. Set the CommandType property to CommandType.StoredProcedure 3. Call the command objects ExecuteNonQuery method. How can we force the connection object to close after my DataReader is closed? objDataReader = objCommand.ExecuteReader(CommandBehavior.CloseConnection) I want to force the DataReader to return only schema of the datastore rather than data? objDataReader = objCommand.ExecuteReader(CommandBehavior.SchemaOnly) How can we cancel all changes done in dataset? How do we get values which are changed in a dataset? Directly updating the data source using dataset object Dataset.datatable.acceptchanges Whats difference between Dataset Clone and Dataset Copy? Clone copies the structure of the dataset alone and Copy copies both the structure and the data of the dataset. Explain in detail the fundamental of connection pooling? Connection pools are actually containers that contain open and reusable connections. Multiple pools can exist in the same application domain at the same point in time, but Connection Pools cannot be shared across application domains. Note that one pool is created per unique connection string. A Connection Pool is created the first time a request

for a connection to the database comes in with a unique connection string. Note that if another request comes in with a different connection string for the database, another Connection Pool would be created. Hence, we have one Connection Pool per connection string and not per database. What is Maximum Pool Size in ADO.NET Connection String? Default -100 Min Pool size - 0 How to enable and disable connection pooling? Max Pool Size=50; Min Pool Size=5; Pooling=True; What are the two fundamental objects in ADO.NET? 1. Dataset 2. DataReader Which is the best place to store connectionstring in .NET projects? Web applications - Web.Config file Windows Applications App.Config file How can we fine tune the command object when we are expecting a single row or a single value? Using the ExecuteScalar method Describe main differences between ADO.NET and classic ADO. 1. As in classic ADO we had client and server side cursors they are no more present in ADO.NET. Note its a disconnected model so they are no more applicable. 2. Locking is not supported due to disconnected model. 3. All data are stored in XML in ADO.Net as compared to classic ADO where data can be stored in binary format also. What is the use of connection object? They are used to connect a data to a Command object. 1. An OleDbConnection object is used with an OLE-DB provider. 2. A SqlConnection object uses Tabular Data Services (TDS) with MS SQL Server. What are basic methods of Dataadapter? 1. Fill 2. FillSchema 3. Update What are the various methods provided by the dataset object to generate XML? 1. ReadXML Reads a XML document in to Dataset. 2. GetXML This is a function which returns the string containing XML document. 3. WriteXML This writes a XML data to disk

Potrebbero piacerti anche