can u give one sinario when you use Abstract Class and When
you use Interface.
Answer Posted / srinivasa
If there are multiple objects which use common methods and
different implementaion of methods We use Abstract class.
If multiple objects use different implementation of methods
for every object we use interface.
| Is This Answer Correct ? | 1 Yes | 3 No |
Post New Answer View All Answers
is it possible to instantiate the math class?
Can interface be private in java?
What is class and object in java?
Explain the scope of a variable.
What is stored procedure. How do you create stored procedure ?
What string is utf8?
How does sublist works in java?
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.
Difference between final and effectively final ? Why is effectively final even required ?
Can you extend main method in java?
What are the types of relation?
What is update method called?
What is unicode datatype?
What is class variable java?
What is identifier in java?