Answer Posted / guest
You can derive a class from any number of base
classes. Deriving a class from more than one direct base
class is called multiple inheritance.
In the following example, classes A, B, and C are
direct base classes for the derived class X:
class A { /* ... */ };
class B { /* ... */ };
class C { /* ... */ };
class X : public A, private B,
public C { /* ... */ };
The following inheritance graph describes the
inheritance relationships of the above example. An arrow
points to the direct base class of the class at the tail of
the arrow:
The order of derivation is relevant only to determine the
order of default initialization by constructors and cleanup
by destructors.
| Is This Answer Correct ? | 13 Yes | 1 No |
Post New Answer View All Answers
What is encapsulation in ict?
What is abstraction in oops?
What is difference between inheritance and polymorphism?
What are the 4 main oop principles?
What is a class oop?
Write a program to implement OOPS concepts such as inheritance, polymorphism, friend function, operator overloading?
given a set based questions and 5 questions based on it next data sufficiciency questions 2 and 2/3 english sentence completion with options very easy and 2 synononmys paragraph with 10 questions 10 minutes replace =,-,*,% with -,%,+,* type questions 5 3 questions lik following itssickhere itssickthere itssickhere istsickhere which is nt alike the others very easy
INSTANCE FIELDS DECLARED private ARE ACCESSIBLE BY THE METHODS ONLY.CAN WE CHANGE THE private FIELD OF AN OBJECT IN A METHOD OF SOME OTHER OBJECT OF THE SAME CLASS?
They started with the brief introduction followed by few basic C++ questions on polumorphism, inheritance and then virtual functions. What is polymorphims? How you will access polymorphic functions in C? How virtual function mechanism works?
What is polymorphism in oops with example?
What is the point of polymorphism?
what is different between oops and c++
What is the main feature of oop?
Who invented oop?
This program numbers the lines found in a text file. Write a program that reads text from a file and outputs each line preceded by a line number. Print the line number right-adjusted in a field of 3 spaces. Follow the line number with a colon, then one space, then the text of the line. You should get a character at a time and write code to ignore leading blanks on each line. You may assume that the lines are short enough to fit within a line on the screen. Otherwise, allow default printer or screen output behavior if the line is too long (i.e., wrap or truncate). A somewhat harder version determines the number of spaces needed in the field for the line numbers by counting lines before processing the lines of the file. This version of the program should insert a new line after the last complete word that will fit within a 72-character line.