what is difference between method overloading & method
overridding with example?

Answer Posted / rana.ankur

overloading:
class A
{
Num(int a)
{
System.out.println("a: " + a);

}
Num(int a,int b)//overloading
{
System.out.println("a and b: " + a + " " + b);

}
CLass Overloading
{
public satic void main(Stinr ar[])
}
A a=new A()
a.Num(12);
a.Num(12,12);
}
}//thanks

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is finalize()?

720


Is node a data type in java?

603


What are the concepts of 'OOPS'?

691


What is the difference between JVM and JRE?

707


What are methods of a class?

627






Are arrays static in java?

671


What is void data type?

661


Which one of the following suits the description of a string better: derived or primitive?

611


design an lru cache in java?

634


What is null mean in java?

714


How is hashset defined in java?

604


What does isempty () do in java?

700


Why is the main method declared static?

678


Can variables be used in java without initialization?

644


how is final different from finally and finalize in java?

689