Difference between overloading and Overriding. <Giving a
confusing example to test the concept.>
(also asked in PA Consultancy Group,iflex,Value
chain,IBM,CTS,Accenture, Tarang>

Answer Posted / arthi

overloading means same method name but different parameters
are passed but overriding means same method name with same
parameters passed in different classes.

Is This Answer Correct ?    40 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is linkedlist in java?

502


Can we define constructor in inner class?

535


What is Applet Stub Interface ?

1962


What is singleton pattern?

552


What is a substring of a string?

559






What is use of functional interface in java 8? Explain

565


Can we override the overloaded method?

561


Draw a UML class diagram for the code fragment given below: public class StringApplet extends Applet { private Label sampleString; private Button showTheString; private ButtonHandler bHandler; private FlowLayout layout; public StringApplet() { sampleString = new Label(" "); showTheString = new Button (" Show the String"); bHandler = new ButtonHandler(); layout = new FlowLayout(); showTheString.addActionListener(bHandler); setLayout(layout); add(sampleString); add(showTheString); } class ButtonHandler implements ActionListener { public void actionPerformed(ActionEvent e) { samplestring.setText("Good Morning"); } } } Note: The methods need not be indicated on the diagram.

1586


What is the difference between and ?

505


Why volatile is used in java?

526


Can we override constructors?

541


Is linked list a linear or non-linear data structure?

543


Which methods are used during serialization and deserialization process?

550


Explain working of call by reference function invoking.

585


Difference between Linked list and Queue?

604