Prizes & Awards
My Profile
Active Members
TodayLast 7 Days
more...
|
New Feature: Community Sites:
Create your own .NET community website and start earning from Google AdSense !
It's Free !
|
Questions related to OOPS
Posted Date: 29 Sep 2008 Resource Type: Articles Category: .NET Framework
|
Posted By: Vivek Member Level: Gold Rating: Points: 10
|
1. What is a class? Answer: Class is concrete representation of an entity. It represents a group of objects, which hold similar attributes and behavior. It provides Abstraction and Encapsulations. 2. What is an Object? What is Object Oriented Programming? Answer: Object represents/resembles a Physical/real entity. An object is simply something you can give a name. Object Oriented Programming is a Style of programming that represents a program as a system of objects and enables code-reuse. 3. What is an Interface? Answer: An interface has no implementation; it only has the signature or in other words, just the definition of the methods without the body. 3. What is Encapsulation? Encapsulation is binding of attributes and behaviors. Hiding the actual implementation and exposing the functionality of any object. Encapsulation is the first step towards OOPS, is the procedure of covering up of data and functions into a single unit (called class). Its main aim is to protect the data from out side world. 4. What is Abstraction? Answer: Hiding the complexity. It is a process of defining communication interface for the functionality and hiding rest of the things. 5. What is Overloading? Answer: Adding a new method with the same name in same/derived class but with different number/types of parameters. It implements Polymorphism. 6. What is Overloading? Answer: A process of creating different implementation of a method having a same name as base class, in a derived class. It implements Inheritance. 7. What is Shadowing? Answer: When the method is defined as Final/sealed in base class and not override able and we need to provide different implementation for the same. This process is known as shadowing, uses shadows/new keyword. 8. What is Inheritance? Answer: It is a process of acquiring attributes and behaviors from another object (normally a class or interface). 9. What is an Abstract class? Answer: An abstract class is a special kind of class that cannot be instantiated. It normally contains one or more abstract methods or abstract properties. It provides body to a class. 10. What is an Interface? Answer: An interface has no implementation; it only has the signature or in other words, just the definition of the methods without the body. 11. What is Polymorphism? Answer: Mean by more than one form. Ability to provide different implementation based on different number/type of parameters. 12. What is Pure-Polymorphism? Answer: When a method is declared as abstract/virtual method in a base class and which is overridden in a base class. If we create a variable of a type of a base class and assign an object of a derived class to it, it will be decided at a run time, which implementation of a method is to be called. This is known as Pure-Polymorphism or Late-Binding. 13. What is a Constructor? Answer: A special Method Always called whenever an instance of the class is created. 14. What is a Destructor? Answer: A special method called by GC. just before object is being reclaimed by GC. 15. How a base class method is hidden? Answer: Hiding a base class method by declaring a method in derived class with keyword new. This will override the base class method and old method will be suppressed. 16. What Command is used to implement properties in C#? Answer: get & set access modifiers are used to implement properties in c#. 17. What is method overloading? Answer: Method overloading is having methods with same name but carrying different signature, this is useful when you want a method to behave differently depending upon a data passed to it. 18. Can constructors have parameters? 19. What are Static Assembly and Dynamic Assembly? Answer: Static assemblies can include .NET Framework types (interfaces and classes) as well as resources for the assembly (bitmaps, JPEG files, resource files, and so forth). Static assemblies are stored on disk. Dynamic assemblies run directly from memory and are not saved to disk before execution. 20. Describe the functionality of an assembly. Answer: It is the smallest unit that has version control. All types and resources in the same assembly are versioned as a unit and support side by side execution. Assemblies contain the metadata and other identities which allow the common language runtime to execute. They are the boundaries providing the type check. They the unit where security permissions are requested and granted. 21. What is serialization? Answer: Serialization is the process of converting an object into a stream of bytes. De-serialization is the opposite process of creating an object from a stream of bytes. Serialization/De-serialization is mostly used to transport objects (e.g. during remoting), or to persist objects (e.g. to a file or database). There are two separate mechanisms provided by the .NET class library for serialization - XmlSerializer and SoapFormatter and BinaryFormatter. Microsoft uses XmlSerializer for Web Services, and uses SoapFormatter/BinaryFormatter for remoting.
|
Responses
|
No responses found. Be the first to respond and make money from revenue sharing program.
|
|