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
What is linkedlist in java?
Can we define constructor in inner class?
What is Applet Stub Interface ?
What is singleton pattern?
What is a substring of a string?
What is use of functional interface in java 8? Explain
Can we override the overloaded method?
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.
What is the difference between and ?
Why volatile is used in java?
Can we override constructors?
Is linked list a linear or non-linear data structure?
Which methods are used during serialization and deserialization process?
Explain working of call by reference function invoking.
Difference between Linked list and Queue?