Ans :

In c# Constant variables are declared and initialized at compile time. The value can't be changed afterwards. Read only is used only when we want to assign the value at run time.

 

Ans :

 Serialization is the process of converting an object into a stream of bytes is called Serialization. For an object to be serializable, it should implement ISerialize Interface.

De-serialization is the reverse process of creating an object from a stream of bytes.

 

Ans :

The using block is used to obtain a resource and use it and then automatically dispose of when the execution of block completed.

 

Ans :

An argument passed as ref must be initialized before passing to the method whereas out parameter needs not to be initialized before passing to a method.

 

Ans :

A constructor is a member function in a class that has the same name as its class. The constructor is automatically invoked whenever an object class is created. It constructs the values of data members while initializing the class.

 

Ans :

An object is an instance of a class through which we access the methods of that class. "New" keyword is used to create an object. A class that creates an object in memory will contain the information about the methods, variables and behavior of that class.

 

Ans :

Public: Public declared variables or methods are accessible anywhere in the application. Static declared variables or methods are globally accessible without creating an instance of the class.

Static: Static member are by default not globally accessible it depends upon the type of access modified used. The compiler stores the address of the method as the entry point and uses this information to begin execution before any objects are created.

Void: Void is a type modifier that states that the method or variable does not return any value.

 

Ans :

No, Multiple catch blocks can't be executed. Once the proper catch code executed, the control is transferred to the finally block and then the code that follows the finally block gets executed.

 

Ans :

ExecuteScalar returns output value where as ExecuteNonQuery does not return any value but the number of rows affected by the query. ExecuteScalar used for fetching a single value and ExecuteNonQuery used to execute Insert and Update statements.

 

 

Ans :

The Page.Validate() method is used to force all the validation controls to run and to perform validation.

 
Page 3 of 10