Correct example of inheritance

Assignment Help JAVA Programming
Reference no: EM13159227

Question 1: A class object can be _____. That is, it can be created once, when the control reaches its declaration, and destroyed when the program terminates.

       static
       automatic
       local
       public

Question 2: When composition is used:
       the host object is constructed first and then the member objects are placed into it.
       member objects are constructed first, in the order they appear in the host constructor's initializer list.
       member objects are constructed first, in the order they are declared in their own class.
       member objects are constructed last, in the order they are declared in the host's class.

 

Question 3: The private members of a base class can
       never be accessed by a derived class.
       be directly and indirectly accessed by a derived class.
       be indirectly accessed by a derived class.
       be directly accessed by a derived class.

 

Question 4: To overload a member function of the base class
       the name of the function and the formal parameter list of the corresponding function in the derived class must be the same.
       the name of the function must be different and the formal parameter list of the corresponding function in the derived class must be the same.
       the name of the function and the formal parameter list of the corresponding function in the derived class must be different.
       the name of the function must be the same and the formal parameter list of the corresponding function in the derived class must be different.

 

Question 5: Which of the following is true about a derived class?
       A derived class can directly access any member variable of the base class.
       A derived class can redefine any public member function of the base class.
       A derived class can have at most one base class.
       A derived class can redefine any member function of the base class.

 

Question 6: Which of the following statements about inheritance is true if the memberAccessSpecifier is protected?
       The private members of the base class become protected members of the derived class.
       The derived class can directly access any member of the base class.
       The public members of the base class become protected members of the derived class.
       The protected members of the base class become private members of the derived class.

 

Question 7: Consider the following class definitions:

class bClass
{
public:
     void setX(int);
     void print() const;
private:
     int x;
};
class dClass: public bClass
{
public:
     void setXY(int, int);
     void print() const;
private:
     int y;
};

Which of the following statements correctly redefines the member function print of bClass?
       void dClass::print() const {dClass:print(); }
       void dClass::print() const { cout << endl; }
       void bClass::print() const { cout endl; }
       void dClass::print() const { bClass::print(); cout }

 

Question 8: Which one of the following statements is a correct example of inheritance?
       An automobile has an engine.
       An automobile is a Mustang.
       A Mustang is an automobile.
       An engine is part of an automobile.

 

Question 9: Which of the following relationships is not a correct example of inheritance?
       Parent to Children
       Aunt to Uncle
       Grandparent to Grandchild
       Father and Mother to Children

 

Question 10: In a multifile, object-oriented C++ project, which file contains the class definition?
       classname.cpp
       classname.h
       classname.def
       classname.hdr

Reference no: EM13159227

Questions Cloud

How does the hiv virus make new viral proteins : How does the HIV virus make new viral proteins and viral genomes, Which of these processes are carried out by viral vs. human enzymes/structures? How does the virus get out again or be totally eliminated from the body? Remember to focus on the flo..
Family-status of children-role of women : Research what a person would need to know in order to visit your country successfully. In your search, look for topics such as family, status of children, role of women, role of the aged, customs,
Fair-value of identifiable net assets : In a business combination accounted for as an acquisition, how should the excess of fair value of identifiable net assets acquired over implied value be treated?
Write a program that plays a tic-tac-toe game. : Using functional decomposition, write a program that plays a tic-tac-toe game.
Correct example of inheritance : Which of the following relationships is not a correct example of inheritance?  Parent to Children  Aunt to Uncle  Grandparent to Grandchild
What is a marketing information system : What is a marketing information system and what should it provide? How is the value of a marketing information system measured?
What is the change in the number of unemployed people : What is the change in the number of unemployed people in this particular month and what is the change in the number of  employed people  in the same period?
Competitive intelligence activities : What competitive intelligence activities can technology help a company to perform better? Are there limitations? Which ones will you choose for which industries? Explain
Non-controlling interest in the total income : Year 3 amortization of differences between current fair values and carrying amounts of Scooter's identifiable net assets at the date of the business combination was $45,000. The noncontrolling interest in net income of Scooter for Year 3 was:

Reviews

Write a Review

JAVA Programming Questions & Answers

  Design an abstract data type in java

Design an abstract data type in Java that represents a musical pitch

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Write java application to input three integers from user

Write Java application that inputs three integers from user and displays sum, average, product, smallest, and largest of the numbers.

  Write java program to utilizes gui with five text fields

Write down the program called MaxMinAvgGUI.java which utilizes GUI with five(5)text fields which asks user to enter 5(five) decimal numbers. 1(one)number in each text field.

  Java program to declares integer array

Write a complete Java program to declares integer array, intArray, and initialize it to {1, 2, 3, 4, 5, 6, 7}.

  Java problem - g queue

A queue is an ordered collection of items in which the removal of items is restricted to the FIFO ( rst in rst out) principle.

  Write java program which will permit user to input data

Write the Java Program which will permit the user to input data. The data will be validated using a loop that requires the user to input the data until it is correct or in the correct range. T

  Create java program to describe inheritance and polymorphism

Create a Java program based on the geometric shapes example described at the beginning of this lesson using Classes Square, Triangle, Rectangle, and Circ leto help describe inheritance and polymorphism.

  Java program to compute invoice for client

You need a java program to compute the invoice for client and then print out invoice to the screen. The consulting rate is $200 per hour.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

  Define private instance variable to hold boolean value

Write a Java Enumeration "LetterGrade" that represents letter grades A through F including plus and minus grades. Define a private instance variable to hold a boolean value.

  Implement an intrusion detection system in java

You are to implement an intrusion detection system in java. Calculate a threshold for detecting an intrusion. The threshold is 2*(Sums of weights).

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd