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
Can we catch more than one exception in single catch block?
How will you invoke any external process in java?
What is command line argument in java?
In Java list the methods that can be overridden?
Explain reverse a linked list recursive java solution?
What is an object's lock and which object's have locks in java programming?
What are advantages of exception handling in java?
Write down program for following scenario. Use java coding standard. You have array list with some words in it..we will call it as dictionary….and you have a arbitrary string containing some chars in it. You have to go through each word of dictionary and find out if that word can be constructed with the help of chars from arbitrary string given. If you find the word print it else print none.
Is set thread safe java?
What is the difference between hashmap and hashtable? What is an interface?
How do you make an arraylist empty in java?
What is the difference between the prefix and postfix forms of the ++ operator?
What is the use of flag?
What are format specifiers in java?
What is the purpose of the file class in java programming?