The following program is Overloading or Overriding?
public class PolymorphismEx {
public int sampleMethod(int a) {
return a;
}

public String sampleMethod(int a) {
return "Is it Overloading or Overriding???";
}
}

Answer Posted / venkat asha reddy

it is neither overloading nor overriding. it throws method
ambiguity exception while compiling

Is This Answer Correct ?    16 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the 3 types of control structures?

531


Can you start a thread twice in Java?

637


What is the main difference between java platform and other platforms?

511


Explain what are final variable in java?

578


Explain java coding standards for constants?

581






What does system out println () do?

563


What is the syntax and characteristics of a lambda expression? Explain

547


How do you sort objects in java?

522


How to obtain a performance profile of java program

547


Is a case study a method or methodology?

468


What is the memory leak in java?

530


What is classname class in java?

538


What is string buffer?

506


What do you understand by the bean persistent property?

558


What is the purpose of methodology?

641