There are 2 methods in a class. Both have the same method
signature except for return types. Is this overloading or
overriding or what is it?
Answer Posted / ashu_deepu
it is not overloading bcos different return types does not mean overloading.
n 4 overriding inheritance should b used between 2 classes.
so it is neither overriding nor overloading.
| Is This Answer Correct ? | 8 Yes | 0 No |
Post New Answer View All Answers
Explain restrictions for using anonymous inner classes?
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 JVM and JRE?
What does bitwise or mean?
Can a private method of a superclass be declared within a subclass?
Is static a singleton?
What do you mean by ordered and sorted in collections in java?
How transient variable is different from volatile variable?
Convert a BST into a DLL and DLL to BST in place.
Why parameters should be passed by reference?
What are advantages of exception handling in java?
What is valid keyword in java?
How do you execute a thread in java?
What is the use of default method in interface in java?
How does arraylist size increase in java?