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
In this exercise, you will write a class that represents how you spend your time during the week The class should have four doub
Nuetrik [128]

Answer:

Answered below

Explanation:

# Program is written in Java

class WeekHours{

double school;

double fun;

double sleep;

double sports;

WeekHours( ){

school = 0.0;

fun = 0.0;

sleep = 0.0;

sports = 0.0;

}

public void setSchool ( double x){

school = x;

}

public void setFun( double y){

fun = y;

}

public void setSleep( double w){

sleep = w;

}

public void setSports( double z){

sports = z;

}

public void totalHours(){

double tHours = school + fun + sleep + sports;

System.out.print(tHours);

}

}

4 0
3 years ago
How did mechanical clocks assist in completing work? How was work done previously?
lozanna [386]

Answer

Timekeeping has been a part of society since Ancient Egypt. The use of spring-powered mechanisms allowed clocks to be made smaller ... Essentially, the church bells and the mechanical clock now became the monitor of the working day.

Explanation:

4 0
2 years ago
The part of the eye thats similar to the film of a camera is the
Lapatulllka [165]
The retina is the part pf the eye that is similar to the film of a camera. It is a thin layer of cells that is located at the back of the eyeball. This part contains photoreceptor cells which respond to light where the neural signals received undergoes complex processing by other neurons in the retina.
3 0
2 years ago
How do i install windows 7 on virtual machine?​
liberstina [14]

Choose Start→All Programs→Windows Virtual PC and then select Virtual Machines. Double click the new machine. Your new virtual machine will open onto your desktop. Once it's open, you can install any operating system you want.

3 0
2 years ago
Earning wise scope of web and mobile app development
lubasha [3.4K]

Answer:

Mobile are build in a specific platform such as Android, iOS ect and they use application such as apple store and have access to the system such as GPS and the camera. Mobile apps live and run on mobiles as on they are their own thing controlled by a developer on the other end

Explanation:

3 0
3 years ago
Other questions:
  • Electrical pressure is also called
    5·2 answers
  • The ____ shortcut keys remove character formatting. (points : 2) ctrl 0 (zero) ctrl i ctrl spacebar ctrl u
    8·2 answers
  • What is the smallest unit of data on the hard drive?
    5·1 answer
  • Why do most laptops have LCD rather than OLED displays, which are found on mobile devices?
    9·1 answer
  • Write a program that unpickle's employee dictionary and while reading from the dictionary, it allows users to lookup an employee
    9·1 answer
  • For the questions below, consider a class called ChessPiece. This class has two instance data, String type and int player. The v
    13·1 answer
  • Circular errors are caused by adding the cell name of a/an _______ cell to a formula.
    6·2 answers
  • Me inculparon de crear una cuenta en Facebook y colocaron el barrio donde vivo, ¿cómo podría demostrar lo contrario? Ayuda urgen
    6·1 answer
  • PLZZZ HELP MEE i need it done today
    7·1 answer
  • Which item can be added to Outlook messages, like a Word document or PowerPoint presentation, that takes standard bulleted lists
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!