1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Mashcka [7]
3 years ago
7

A constructor can be overloaded with more than one function which has the same name but with what two different things

Computers and Technology
1 answer:
andreyandreev [35.5K]3 years ago
5 0
<h2>Answer:</h2>

i. Number of parameters

ii. Type of parameters

<h2>Explanation:</h2>

When there are two or more constructors, definitely with the same name, in a given class, then the constructors are said to be overloaded. An overloaded constructor appears declared many times in a class but each time with different number of parameters and/or type of parameters.

For example, given a class Test, the following combination of constructors can exist;

i. public Test(int x){

   

 }

ii. public Test(String m){

     

  }

iii. public Test(int a, String b){

 

}

<em>The following should be noted;</em>

In the case of combination (i) and (ii), the constructors have the same number of parameters but different type of parameter. In other words, they both have 1 parameter but while the first one has a parameter type of <em>int</em>, the second has a parameter type of <em>String</em>.

In the case of combination (ii) and (iii), the constructors have different number of parameters and of course different type of parameters. In other words, the second constructor has 1 parameter of type <em>String</em> while the third constructor has 2 parameters of types <em>int</em> and <em>String</em>.

You might be interested in
Create a program that prints out a list of all the divisors of a number stored in a variable. (If you don’t know what a divisor
UkoKoshka [18]

Answer:

// Program is written in C++ Programming Language

// Comments are used for explanatory purpose

// Program starts here

#include<iostream>

using namespace std;

int main()

{

// Declare integer variable n which serves as the quotient.

int n;

// Prompt to enter any number

cout<<"Enter any integer number: ";

cin>>n;

// Check for divisors using the iteration below

for(int I = 1; I<= n; I++)

{

// Check if current digit is a valid divisor

if(n%I == 0)

{

// Print all divisors

cout<<I<<" ";

}

}

return 0;

}

7 0
3 years ago
Which type of packet is sent by a dhcp server after receiving a dhcp discover message?
emmasim [6.3K]
A<span> DHCPOffer packet is sent to the client.</span>
5 0
3 years ago
__________ requires unbiased and careful questioning of whether system elements are related in the most effective ways, consider
Liono4ka [1.6K]

Answer:

The answer is "Critical analysis".

Explanation:

Critical analysis is a part of the operating system, that provides an analysis, which is used to process all bits in a system and run their computer system more efficiently.

  • This analysis is used in contextual writing because It reflects the author's interpretation or perception of the text.
  • This analysis hosts vulnerabilities in current desktop operating systems objectively.
5 0
3 years ago
You have an application that you would like to run on your Windows workstation every Monday at 3:00 p.m. Which tool would you us
NikAS [45]

Answer:

Task Scheduler

Explanation:

Task Scheduler allows you to automate tasks in Windows 10

7 0
3 years ago
Frequently used data is identified and read from the hard disk into memory, or _____, and is easily accessible when needed.
frutty [35]

Answer:

The answer would be disk cache.

7 0
3 years ago
Other questions:
  • You have been tasked with training end users in security best practices and have observed a trend among users in which many are
    14·1 answer
  • Assume that isIsosceles is a bool variable, and that the variables isoCount, triangleCount, and polygonCount have all been decla
    11·1 answer
  • Nick is working on a new graphic for one of his company’s clients and is having an issue with the color on his screen. The clien
    8·1 answer
  • 2 Consider the sequence of keys (5,16,22,45,2,10,18,30,50,12,1). Draw the result of inserting entries with these keys (in the gi
    13·1 answer
  • Boardman College maintains two files—one for Sociology majors and another for Anthropology majors. Each file contains students'
    5·1 answer
  • Suppose that a is a one-dimensional array of ints with a length of at least 2. Which of the following code fragments successfull
    8·1 answer
  • Write HTML code for inserting an image "cricket.jpeg" in size 500 width and 400 height.
    12·1 answer
  • If you have an equipment failure while driving on an expressway, you should
    8·1 answer
  • Write an application that displays the strings in the provided array alphabetically in ascending order.
    9·1 answer
  • Verbs in the active and passive voice
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!