What is the difference between overloading and overriding a
function?

Answer Posted / praveen

Over riding also can be happens in the same class

eq :-

public void test(int i)
{
System.out.println(i);
}
public void test(String i)
{
System.out.println(i);
}

Over Loading - Compile time polymorphism
Over Riding - Run time polymorphism

Is This Answer Correct ?    5 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are thread safe functions?

504


What is the difference between preemptive scheduling and time slicing in java programming?

524


Is finalize() similar to a destructor?

544


What is the difference between an array and an array list?

495


What is abstraction in java?

611






Why Set interface contains unique elements, what internally implemented for this so that it contains unique elements?

7398


Define a package.

561


What are "methods" and "fields"?

567


Can we sort hashmap in java?

524


What is the default access specifier for variables and methods of a class?

559


What is ascii format?

539


What is yield () in java?

476


What is the use of static class?

537


Does a function need a return?

525


What is the primitive type short?

572