What is the difference between overloading and overriding a
function?

Answer Posted / raj kashyap

OVERLOADING is possible to create methods that have the same
name, but different parameters lists and different
definitions.overloading is used when objects are required to
perform similar task but using different parameters.



OVERRIDING is used when we want an object to respond to the
same method but have different behaviour when that method is
called. that means we override the method defined in super
class.yhis is possible by defining a method in subclass that
has same name,same argument& same return typeas method in
super class.

Is This Answer Correct ?    12 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is java oops?

549


What is an empty string in css?

518


Is hashmap thread safe?

550


What is the difference between compiler and jvm?

541


What is sizeof in java?

551






define polymorphism in java

625


What is a singleton puppy?

520


Add a value x to array from index l to r where 0 <= l <= r <= n-1

615


Is ++ operator is thread safe in java?

509


Does java trim remove newline?

534


what is thread? What are the high-level thread states? Or what are the states associated in the thread? : Java thread

487


Why bytecode is called bytecode?

577


What language is an assembler written in?

541


What is executor memory?

506


What does super keyword do?

550