Interview Question

Software Engineer Intern Interview(Student Candidate)

What is the difference between an abstract class and an

  interface?
Tags:
technical
Answer

Interview Answer

2 Answers

0

An abstract class can provide a default implementation, while an interface cannot. Both aren't very exciting by themselves, and need to have classes that extend them. [Gave an example about abstract class].

Interview Candidate on Jan 28, 2012
0

In an interface none of the methods that are declared can have a body while in an abstract class there can be some methods which have a body and some dont. Also there can be other variables declared in an abstract class but in an interface if a variable is declared it should be declared as final.

Ganesh Bhat on Feb 24, 2012

Add Answers or Comments

To comment on this Question, Sign In with Facebook or Sign Up