explain about method overloading and method overriding with
difficult examples

Answer Posted / mayank sharma

Clas A
{
Virtual void hi(int a)
{
}
}

Class B:A
{
public overrid void hi(int a)
{

}
}

Overloading simply involves having a method with the same
name within the class.

Example for Over loading

Class A
{
class a()

{

}
class a(int a)
{
}
}

Is This Answer Correct ?    0 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you initialize an arraylist in java?

513


What if constructor is protected in java?

563


What is an empty list in java?

534


What is the largest number a double can hold?

567


How define set in java?

515






How to provide security in java

1805


What is immutability in java?

610


What is a singleton puppy?

536


What is time complexity java?

541


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

545


What is the difference between call by reference and call by pointer?

507


Is null false in java?

709


Why are functions called methods in java?

535


List some important characteristics on jre

596


How can you say java is object oriented?

595