OBJECT ORIENTED PROGRAMMING CIS 3100

Here class c is derived from two base classes a and b

Info icon This preview shows pages 11–13. Sign up to view the full content.

View Full Document Right Arrow Icon
Here class C is derived from two base classes A and B. 75. Define Hierarchical inheritance. In hierarchical inheritance, more than one class is derived from a single base class. Here class B and C are derived from class A. 76. Define Hybrid inheritance. Hybrid inheritance is defined as a combination of more than one inheritance. Here, Classes A, B and C represent hierarchical inheritance. Classes A, B & D and classes A, C and D represent multilevel inheritance. Classes B, C and D represent multiple inheritance. 77. What is an abstract class? An abstract class is one that is not used to create objects. It is designed only to act as a base class to be inherited by other classes. 78. What is a virtual base class? Here, class D inherits both classes B and C which are derived from the same base class A. Hence D has two copies of the properties of class A. This can be avoided by declaring classes B and C as virtual base classes. 79. What are the types of polymorphism? The two types of polymorphism are, C A B B A B A C C D A B C D
Image of page 11

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
• Compile time polymorphism – The compiler selects the appropriate function for a particular call at the compile time itself. It can be achieved by function overloading and operator overloading. • Run time Polymorphism - The compiler selects the appropriate function for a particular call at the run time only. It can be achieved using virtual functions. 80. Define ‘this’ pointer. A ‘this’ pointer refers to an object that currently invokes a member function. For e.g., the function call a. show () will set the pointer ‘this’ to the address of the object ‘a’. 81. What is a virtual function? (Nov/Dec 2010) When a function is declared as virtual, C++ determines which function to use at run time based on the type of object pointed to by the base pointer, rather than the type of the pointer. 82. What is a pure virtual function? (April/May 2011) (Nov/Dec 2011) A virtual function, equated to zero is called a pure virtual function. It is a function declared in a base class that has no definition relative to the base class. 83. How can a private member be made inheritable? A private member can be made inheritable by declaring the data members as protected. When declared as protected the data members can be inherited by the friend classes. JAVA 84. What are the various java features? The various java features are, • Compiled and interpreted • Platform independent and portable • Object oriented • Robust and secure • Distributed • Familiar, small and simple • Multithreaded and interactive • High performance, Dynamic and extensible 85. What are the two types of Java programs? The two types of Java programs are, • Stand alone applications • Web applets 86. What are the steps involved in executing a stand alone java program? The steps involved in executing a stand alone java program are, • Compiling source code into byte code using javac compiler • Executing the byte code program using java interpreter 87. What is the character set used in Java?
Image of page 12
Image of page 13
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern