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
Susan's monthly goal to open five new customer
SSSSS [86.1K]

Answer:

2. Measurable Goal

Explanation:

If she works hard, she can open 5 more customer accounts in time. I tried my best to answer this question, hope it helps!

4 0
3 years ago
What is the importance of internet safety?
bearhunter [10]

Answer:

1. Identity theft

2. Safety for you and your family and personal info

3. Harrasement and bullying prevention

Some things never to share on the internet with strangers...

1. Full name

2. Birthday

3. State or city of home

4. Pictures of yourself

5. Personal info about you or your family members

6. Personal social media links and tags

Explanation:

hOPE THIS HELPS!! I think some people need a reminder of this sometimes! you didnt give any options so i hope this helps you!

7 0
3 years ago
Write a (java) program with a class called Sum1, using a while loop to add 10 numbers entered from the key-board.
Ainat [17]

This is a java program with a class called Sum1.

Explanation:

While loop is used to add 10 number.

import java.util.Scanner;

public class Sum 1

{

   public static void main(String args[])

   {

       int number, count, sum = 0;

       Scanner s = new Scanner(System.in);

       System.out.print("Enter the number:");

       number = s.nextInt();

       while(number > 0)

       {

           count = number % 10;

           sum = sum + n;

           number = number / 10;

       }

       System.out.println("Sum of Digits:"+sum);

   }

}

5 0
3 years ago
What is the meaning for science?
ELEN [110]
Science is the special kind of knowledge.Science is the special kind of knowledge related to nature and natural phenomena.
5 0
3 years ago
If you need to grasp the topic of a document quickly, which strategy can you follow? A. guessing from context B. paraphrasing C.
Lynna [10]

If you need to grasp the topic of a document quickly, you can use previewing. Correct answer: C

With previewing the document you will get an idea of what it is about without actually reading the main body of the document. Previewing includes reading the the title and author details, reading only the parts that ‘jump out’; that is: main headings and sub headings and examining any illustrations, graphs, tables..

8 0
3 years ago
Read 2 more answers
Other questions:
  • Cover photos have a prominent location in your social media profiles, so you should use this space strategically – for example,
    14·1 answer
  • Which directory in the FHS stores programs and configuration information that can only be executed and modified by the root user
    10·1 answer
  • If you're able to understand directions more easily when you hear them instead of reading them you are most likely
    12·1 answer
  • Which is a good guideline to follow for adding animation to a presentation?. A. Use a different animation for each slide.. B. Us
    8·2 answers
  • A program executes 100 billion instructions. It executes on an IBM processor that has an average CPI of 1.2 and a clock frequenc
    15·1 answer
  • Refer to the following statement: “We have implemented several IT solutions:
    14·1 answer
  • Explain URL's parts with the help of an example.​
    10·1 answer
  • A digital presence created online by an individual or organization using a digital device is called a identity.
    7·1 answer
  • Lookups comes before Tags in the search-time operation sequence. True or False: Lookups can reference Tags.
    15·1 answer
  • As a network architecture, you are tasked with designing a network for a six-story
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!