Escolar Documentos
Profissional Documentos
Cultura Documentos
struct
---------it is value type
-protected not allowed.
-destructor is allowed
-Inheritance possible
-no
23.what is the use of base keyword?
-with the help of base keyword we can access base class
members from derived class.
-always base keyword will refer to immediate base class
members.
-we can call base class constructor from derived class
constructor.
24. What is Constructor?
-it is special method in the class which is invoked automatically
when the class has been instantiated.
-it can be used to initialize instance variables of class to some
meaningful initial values once object has been created.
25.Why name of constructor and class name must be same?
-to make the compiler to identify it easily.
26.Why return type is not allowed for constructor at programmer
level?
-constructor should not be used for any other purpose; it must
be used for only initialization.
27.What are different types of constructors available?
-Static constructor
-Non static constructor
a)default constructor
b) Parametric constructor.
Ref
-it must be
- changes are
Interface
-Fully
-Complete
-Only methods,
-Object cant
-Constrctor,
virtual method
-virtual keyword
-No
68.Can we define abstract method as static?
-No
69.Can we declare private class in namespace?
-No, members of the namespace must be either internal or public
70.what is the difference between new and override keywords?
- New is used to create the object dynamically
-Override key word is used to override either virtual or abstract
methods
71.Can we Create object without defining class?
-Yes, we can create an object by using new operator with some
intialization.
-Based on intialization approriate annonomous type will be
defined by the compiler.
72.what is the purpose of this?
-it is a predefined reference variable which contain the reference
of a current object or active object.
- when the names of the parameters and instance variable
names are same then instance variables can be differentiated
from the parameters by using this keyword.
-This can be used with instance methods only.
73.what is the difference between Array and ArrayList?
Array
ArrayList
---------------------------------------------------------------------------------------------
-fixed size
dynamically.
ArrayList
a)private assembly
---------------------an assembly with out strong name key is called as
private assembly
-when private assembly is used in application,then copy
of it will be available as part of application.so that memory will be
wasted when too many application are running at a time.
-if some changes are made in assembly then they are not
reflected to application until its compilation.