Today I will be discussing Q&A on Object Oriented Techniques.
Q. What Is OOPS ?
Ans. OOPS is an Object Oriented Programming language,which is the extension of Procedure Oriented Programming language.OOPS reduce the code of the program because of the extensive feature of Polymorphism. OOPS have many properties such as Data-Hiding,Inheritence,Data Absraction,Data Encapsulation and many more. It also increases the reusability of the code. Everything in the world is an object. The type of the object may vary. In OOPS, we get the power to create objects of our own, as & when required.
Q. what is Class ?
Ans. A group of objects that share a common definition and that therefore share common properties, operations, and behavior. A user-defined type that is defined with the class-key 'class,' 'struct,' or 'union.' Objects of a class type consist of zero or more members and base class objects.Classes can be defined hierarchically, allowing one class to be an expansion of another, and classes can restrict access to their members.
Q. What are Constructors and Destructors?
Ans. When we create instance of class a special method of that class is called that is constructor. Similarly, when the class is destroyed, the destructor method is called. These are general terms and usually not the actual member names in most object-oriented languages. It is initialized using the keyword New, and is destroyed using the keyword Finalize.
Q. What is Abstract Class ?
Ans. Classes that cannot be instantiated. We cannot create an object from such a class for use in our program. We can use an abstract class as a base class, creating new classes that will inherit from it. Creating an abstract class with a certain minimum required level of functionality gives us a defined starting point from which we can derive non-abstract classes. An abstract class may contain abstract methods & non-abstract methods. When a class is derived from an abstract class, the derived class must implement all the abstract methods declared in the base class. We may use accessibility modifiers in an abstract class.An abstract class can inherit from a non-abstract class. In C++, this concept is known as pure virtual method.
Q. What do u mean by Function Overloading ?
Ans. When more than one function is created with the same name, but difference is of their arguments . In other words, function names can be overloaded. A function may also have the same name as an attribute. In the case that there is an ambiguity between a function on a complex type and an attribute of the complex type, the attribute will always be used.
Q. What is diff. between abstract class and an interface?
Ans. An abstract class and Interface both have method only but not have body of method. The difference between Abstract class and An Interface is that if u call Abstract class then u have to call all method of that particular Abstract class but if u call an Interface then it is not necessary that u call all method of that particular interface.
Keep Reading!!...
Cheers
Padhaku Einstein
Contact me at einstein.padhaku@gmail.com
1 comment:
u give a good concept of oops,keep it up
Post a Comment