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 / jagadish

Duplicate Method sampleMethod(int a) Error Message will display

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does singleton mean in java?

515


What do you mean by stack?

646


What is a variable analysis?

642


What is a functional interface?

549


Explain different types of wrapper classes in java?

603






Can we use both this () and super () in a constructor?

556


What are the advantages of passing this into a method instead of the current class object itself?

1176


What is a locale?

701


How to access arraylist elements in java?

495


What is the return type of the main method?

578


What is an example of a constant variable?

539


What is an object in java?

561


Does java support multiple inheritance or not?

605


What is the basic concepts of OOPS?

695


Can a static method be final?

558