class A
{
public void disp(int a,int b)
{
System.out.println("hai");
}
}
class B
{
public void disp(int a,int b,int c)
{
System.out.println("hai");
}
}

above program is overloading or overriding?

Answer Posted / raji

class A and class B have same function name but different
arguments.overriding is possible only when both class A and
class B have same function name and same arguments.

Is This Answer Correct ?    7 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a file pointer?

725


What is boolean keyword in java?

881


If goto and const is reserve words than why it is not work in java?

1766


What is array command?

821


What do you mean by byte code?

753


Can we define package statement after import statement in java?

789


What is the purpose of return statement?

833


Is multiple inheritance supported by java?

714


Which methods are used during serialization and deserialization process?

753


Which collection is sorted in java?

800


what are Hostile Applets?

1819


What is a method type?

740


What is static keyword in java?

767


Is string a class in java?

746


What is a stringbuilder?

716