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

why doesn't java run on all platforms?

567


Write a factorial program using recursion in java?

518


Explain hashset and its features?

583


Explain super keyword in java.

584


What is the use of join method?

578






Differentiate between static and non-static methods in java.

571


What is the generic function?

528


Explain the difference between call by refrence and call by value?

563


What is the difference between the font and fontmetrics classes in java programming?

505


What are the features of java?

533


Find the value of a specified element of the array arr[i] where 0 <= i <= n-1

543


Why we used break and continue statement in java?

561


Write a program to find maximum and minimum number in array?

553


Explain the available thread states in a high-level?

530


Does constructor be static?

566