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
nika2105 [10]
3 years ago
10

2Discuss the difference between overriding and overloading. (This is a very common interview question in programming)

Computers and Technology
1 answer:
nordsb [41]3 years ago
7 0

Explanation:

Following are the difference between overriding and overloading

(1) Method overloading means method having same name but different parameter or method signature Whereas  Method overriding means method having same name and same parameter or signature.

(2) Method overloading is achieved the compile time Polymorphism whereas Method overriding is achieved the Run time Polymorphism .

(3 ) In method overriding child class have facility to provide a specific implementation of a method which is already defined by parent class method whereas there is no such facility is available in method overloading

(4 )Programming structure of method overloading

class test

{

 void fun()

{

// statement

}

void fun(int b)

{

// statement

}

}

In this fun() method name is same but different signature I.e void fun() and void fun(int a);  

Programming structure of method overriding  

class parent

{

  void fun()

{

// statement in parent class

}

}

class child extends test

{

void fun()

{

// override the statement in child class

}

}

In this fun() method have same name and same signature in both class  

You might be interested in
What might be some challenges if you’re trying to design a product for someone
ValentinkaMS [17]

Answer:

failure

Explanation:

if someone dosnt like it

4 0
3 years ago
Read 2 more answers
What does the machine do and how do the operators react to their work?
Stels [109]

Answer:

The answer is below

Explanation:

Machine functions or does the following:

1.  Transform energy

2.  Change force direction

3.  Increase or decrease speed

4.  Move force over a distance.

Machine operator reacts to their work in the following ways:

1.  Setting the machine for use

2.  Utilizing the machine effectively

3.  Performing machine maintenance

4.  Ensuring maximum optimization of the machine

6 0
4 years ago
Match the metric units with these measurements
zavuch27 [327]
Force:newtons
distance:meters
work:joules
power:either watts or horsepower
energy:joules
time:kiloseconds and milliseconds
6 0
3 years ago
What is a variable?
aleksandr82 [10.1K]
Answer. D: a value that looks loads when the program runs.


Explanation:

In programming, a variable is a value that can change, depending on conditions or on information passed to the program. Typically, a program consists of instruction s that tell the computer what to do and data that the program uses when it is running.
5 0
3 years ago
Mrs. Patel uses a computer program to balance her checkbook. Which of the following best explains how the
Alexandra [31]

Answer:

c it reduces errors

Explanation:

Instead of Mrs.Patel doing it she has an online program made for checks to do it for her.

6 0
3 years ago
Other questions:
  • What of the following google tools support collaboration
    10·1 answer
  • The sum of all the minterms of a boolean function of n variables is equal to 1.
    7·1 answer
  • Choose the sentences that describe techniques of formatting text.
    12·1 answer
  • What is the purpose of the overload keyword in the ip nat inside source list 1 pool nat_pool overload command?
    8·1 answer
  • For Excel:
    5·1 answer
  • How are keyboards applied in the real world
    13·1 answer
  • Find each of the following products using distributive property a) 735 × 16​
    12·1 answer
  • Jamal wants to create a program that will play music during the afternoon. Which kind of loop should be used in the program?
    6·2 answers
  • What is are the most efficient ways to make a slide presentation?
    12·2 answers
  • 2. What are some other reasons why you might need to know the operating system version on your computer or mobile device
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!