when to for abstract class and when to go for interface

Answer Posted / sumit kumar

if your class design have some common and some different
behavior then go for - abstract class
if your class design have only different behavior then go
for interface.

Is This Answer Correct ?    12 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How many boolean functions are there?

502


take an array with -ve and +ve value both.find out the nearest value of 0(zero).if two values are same like(-2 and +2)then extract +2 is nearest of 0(zero).

1529


What is data string?

494


What are disadvantages of java?

517


Explain jvm, jre, and jdk?

557






I am unable to find or learn about print command. I have a graphical program in core java in applet but i want to give print command but i have coding for that so if anyone know about this plz mail me on avdhesh_chauhan007@yahoo.co.in

1593


Is string passed by reference in java?

546


How list contains works in java?

550


Why to use nested classes in java?

583


Can you give names of Container classes?

1852


What is sortedmap interface?

549


What are the major drawbacks of external iteration?

572


What is meant by JVM? Is JVM platform independent or not?

570


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 a get method?

530