Explain method overloading and overriding?

Answer Posted / priyabrata patro

Method overloading happens in class with same method name but by modifying below features
1> By changing number of parameters
2> By changing ordinal position of parameter , i mean to say here is by changing datatype place.
And method overriding happens in two or more than two class , i mean defining same method declaration without any modification within two class and among of that two class , one class must extend another class and further also you can override this method , and this procedure continues till one subclass leaves overriding this method.

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

I am a fresher and know core java, c languge, html, css etc if I am illegible for any job then send it on my email tatranakshay276@gmail.com

1066


Is empty .java file name a valid source file name?

580


What is the final variable?

572


Can substring create new object?

553


What is the lifetime and scope of a variable?

509






Write a java program to print fibonacci series?

534


Why java is considered as platform independent?

582


Which programming language is most secure?

519


What happens when main () method is declared as private?

646


In case of inheritance what is the execution order of constructor and destructor?

633


What checkbox method allows you to tell if a checkbox is checked?

529


What is a ternary operator in java?

526


Can an arraylist be empty?

560


Under what conditions is an object’s finalize() method invoked by the garbage collector?

572


Can we instantiate interface in java?

666