IGNOU BCA MCA Students - VIVA Question Answer for .NET
.NET Selected Question Answer - PART II
6. What is a Class?
a set or category of things having some property or attribute in common and differentiated from others by kind, type, or quality.
7. What is object?
Objects are created from Classes, in C#, is an instance of a class that is created dynamically. Object is also a keyword that is an alias for the predefined type System.
8. What is Constructors, explain with syntax
A is special method of the class that will be automatically invoked when an instance of the class is created is called as constructor.
Constructors are mainly used to initialize private fields of the class while creating an instance for the class.
When you are not creating a constructor in the class, then compiler will automatically create a default constructor in the class that initializes all numeric fields in the class to zero and all string and object fields to null.
Syntax.
[Access Modifier] ClassName([Parameters])
{
}
9. Types of Constructors
Basically constructors are 5 types those are
Default Constructor
Parameterized Constructor
Copy Constructor
Static Constructor
Private Constructor
a set or category of things having some property or attribute in common and differentiated from others by kind, type, or quality.
7. What is object?
Objects are created from Classes, in C#, is an instance of a class that is created dynamically. Object is also a keyword that is an alias for the predefined type System.
8. What is Constructors, explain with syntax
A is special method of the class that will be automatically invoked when an instance of the class is created is called as constructor.
Constructors are mainly used to initialize private fields of the class while creating an instance for the class.
When you are not creating a constructor in the class, then compiler will automatically create a default constructor in the class that initializes all numeric fields in the class to zero and all string and object fields to null.
Syntax.
[Access Modifier] ClassName([Parameters])
{
}
9. Types of Constructors
Basically constructors are 5 types those are
Default Constructor
Parameterized Constructor
Copy Constructor
Static Constructor
Private Constructor
10. index value of the first element in an array?
first element is 0 (zero). In a Array.
11. Different between method overriding and
method overloading?
In Overriding methods it will create two or more methods with same name and same parameter in different classes.
while Overloading it will create more then one method with same name but different parameter in same class.
12. Explain use of Abstract and Sealed Classes in C#?
The abstract keyword enables you to create classes and class members that are incomplete and must be implemented in a derived class.
The sealed keyword enables you to prevent the inheritance of a class or certain class members that were previously marked virtual.
13. What is Static Classes?
A static class is basically the same as a non-static class, but there is one difference: a static class cannot be instantiated.
In other words, you cannot use the new keyword to create a variable of the class type. Because there is no instance variable, you access the members of a static class by using the class name itself.
14. Explain Static Class Members.
A non-static class can contain static methods, fields, properties, or events.
The static member is callable on a class even when no instance of the class has been created. The static member is always accessed by the class name, not the instance name. Only one copy of a static member exists, regardless of how many instances of the class are created.
Static methods and properties cannot access non-static fields and events in their containing type, and they cannot access an instance variable of any object unless it is explicitly passed in a method parameter.
In Overriding methods it will create two or more methods with same name and same parameter in different classes.
while Overloading it will create more then one method with same name but different parameter in same class.
12. Explain use of Abstract and Sealed Classes in C#?
The abstract keyword enables you to create classes and class members that are incomplete and must be implemented in a derived class.
The sealed keyword enables you to prevent the inheritance of a class or certain class members that were previously marked virtual.
13. What is Static Classes?
A static class is basically the same as a non-static class, but there is one difference: a static class cannot be instantiated.
In other words, you cannot use the new keyword to create a variable of the class type. Because there is no instance variable, you access the members of a static class by using the class name itself.
14. Explain Static Class Members.
A non-static class can contain static methods, fields, properties, or events.
The static member is callable on a class even when no instance of the class has been created. The static member is always accessed by the class name, not the instance name. Only one copy of a static member exists, regardless of how many instances of the class are created.
Static methods and properties cannot access non-static fields and events in their containing type, and they cannot access an instance variable of any object unless it is explicitly passed in a method parameter.
No comments:
Post a Comment