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 PostYou CAN declare variables in an interface (Language spec chapter 9.3).
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.