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

  Describe the steps to program development

What is the function of parseFloat and parseInt and what will be result if we send "abcd" through a prompt() input and pass it through parseInt()?

  Create your own date class

You are to write a program that determines the day of the week for New Year's Day in the year 3000. To do this, you must create your own date class (MyDate) and use the following interface and main program:

  Enterprise java beans (ejb) in software development

Enterprise Java Beans (EJB) in software development, EJB technology, EJB application, Stateless Session Beans (SLSB), Stateful Session Beans (SFSB), Message Driven Bean (MDB), Entity Bean

  Design and implement an applet called circles

Design and implement an applet called Circles that draws 50 circles of random diameter in random locations. If the diameter of a circle is less than a certain value, the circle is ?lled with the color yellow.

  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.

  Development of a graphical user interface

To understand actual communication with an SMTP server can be achieved using TCP Sockets and understand the development of a graphical user interface (GUI) and use of event handling.

  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.

  Create a gui version of the game mini sudoku.

Each row has the numbers 1 to 6,Each column has the numbers 1 to 6,Each group of 2 rows by 3 columns also has the numbers 1 to 6.

  Web engineering principles

web application development, Web Engineering methodology, UML-based Web Engineering (UWE), models to the expansion of web applications, Object Oriented Web Solutions (OOWS),Web Modeling Language (WebML) methodology, Object-Oriented Hypermedia Design..

  Design and implement a sorting algorithm

Your task is to design and implement a sorting algorithm and running time grows as a linear function of the array

  Write down the java code for the bank

Write down the java code for the bank of Fraud. User is presented with menu which looks something like this: 1. Deposit 2. Withdrawal 3. Check Balance 4. Exit.

  Java program to find solution of cryptarithmetic puzzle

A solution to puzzle is S=9, R=8, O=0, M=1, Y=2, E=5, N=6, D=7. Write down a java program which finds solution to cryptarithmetic puzzle of: TOO + TOO + TOO + TOO = GOOD.

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