The basic difference would be interface cannot have any method definition or variables declared while an abstract method can have them. Now what is the difference between an abstract class and an interface when they contain only the method signatures in them. In what situations will you use either of them. Can they be used interchangeably.
rje7 2 Junior Poster in Training
Recommended Answers
Jump to PostYou can implement multiple interafaces but you can extend only one class. So be careful with abstract classes in the first place and the only reason to use an abstract class in the case listed above is when there is some common, non-trivial, implementation to be considered as well.
Jump to PostWell, I have no idea what you actually said, nor what the interviewer actually asked (not just your recollection of your interpretation of the question), nor how, exactly, the interviewer expressed his "dissatisfaction" with the answer, nor what, exactly the interviewer was aiming at with the question, so I can't …
All 7 Replies
masijade 1,351 Industrious Poster Team Colleague Featured Poster
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster
rje7 2 Junior Poster in Training
masijade 1,351 Industrious Poster Team Colleague Featured Poster
striker3344 0 Newbie Poster
striker3344 0 Newbie Poster
masijade 1,351 Industrious Poster Team Colleague Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.