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

  Minimal spanning tree decreasing edge dismissal

Minimal Spanning Tree Decreasing Edge Dismissal, Reverse-delete algorithm. Develop an implementation that computes the MST

  Create simulation by java language for single-server queue

Suppose that customer inter-arrival times are exponentially distributed and service times are normally distributed. Create simulation by java language for this problem and view all parametre?

  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.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Distributed systems

Build robust, secure distributed systems using advanced programming techniques

  Create a secure parts inventory catalog system

You will create a secure Parts Inventory Catalog system using Model 2 architecture. The application will require a user to have the proper access right to enter the system, and when satisfied, presents the catalog of items currently available in t..

  Java application to declare and create a vector

Write a java application that perform the following task: declare and create a vector with initial size of 10, increment of 2

  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.

  Create and implement class called date to store month

Create and Implement the class called Date which has data members to store month (as a number), day, year, and name of month.

  Java program for creating a order menu

Assume your consulting company has been hired to construct a program that meets the following requirements.

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