30) can we overload distructor() ?
No, because it is parameter less.
31) what is namespace ?
NameSpace is a logical container. where in we can find classes,wnumerations,interfaces delegates.
32) What is the purpose of namespace?
To avoid the name collisions.
33) what is the diff b/w namespace and class ?
--Namespace is used to avoid the name collisions
-- class is used to implement encapsulation.
34)What is the alias name for namespaces and when it is required?
When ever there is a conflict among the members in the included namespaces, then we can avoid it by providing alias nameto the member where there is a conflict.
35) What is the purpose of params keyword /
params keyword is used to specify the array of parameters to the method.
36) what is the diff between out and ref parameters ?
Out parameters are write only parameters in side the method.
Ref parameters are read-write parameters in side the method.
37) What is Binding ?
Replacing method invokation with its appropriate base reference is called Binding.
38) What is static Binding ?
If the binding process is carried out at the time of compilation is called Static bonding.
39) What is Dynamic binding ?
If the binding process is carried out at the run time is called Dynamic bonding.
40) What are the diff b/w Method overloding and overriding ?
OverLoding OverRiding
1. Nothing but no.of methods defined 1.Nothing but no.of methods defined with
with the same name by showing the same name and same signature.
difference in signature part.
2. Possible with in the same class and 2. possible in the derived class by
derived class the override keyword.
3. possible for static, non-static methods 3.possible for only abstract and virtual
methods.
41) What is polymorphism ?
performing diff actions by invoking same invokation.
42) What is the diff between abstract calss and interface ?
abstract calss Interface
1. partially unimplemented 1. Fully unimplipmented.
2. Complete abstraction is not possible 2. Complete abstraction is possble.
3. All the types of members are allowed. 3. Onlymethods,properties,indexers
and events are allowed.
43) What is sealed class ?
If a class is declared as sealed calss, then it can not be inherited ex: Thread class.
44) What is extension method?
From c# 3.0 we can find this. we can extend the functionality of existing data type by defining extension method.
Always extension methos must be declared as static and defined in static class.
45) What is the use of Dispose Method()?
It is used to Invoke the Garbage collector dynamically.
46) What is the diff b/w string and stringBuilder?
StringBuilder : Manipulation can be done with is the object itself.
String : String class objects will return another instance of the string for each operation .
47) What is the diff b/w Abstract method and Virtual method ?
Abstract Method Virtual Method
1. Must be inside abstract class 1. It can be declared any where.
2. Must be overrided in its derived class 2. It may or may not be overrided in its derived class.
3. should not have the body in base class. 3. Must have the body in base class.
0 comments:
Post a Comment