What is the difference between abstract class and interface?
Answer Posted / srikanth reddy
1. Abstract classes may have some executable methods and
methods left unimplemented. Interfaces contain no
implementation code.
2. An class can implement any number of interfaces, but
subclass at most one abstract class.
3. An abstract class can have nonabstract methods. All
methods of an interface are
abstract.
4. An abstract class can have instance variables. An
interface cannot.
5. An abstract class can define constructor. An interface
cannot.
6. An abstract class can have any visibility: public,
protected, private or none
(package). An interface's visibility must be public or none
(package).
7. An abstract class inherits from Object and includes
methods such as clone() and
equals().
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Is ++ operator thread-safe in java?
What is a flag value?
What does bitwise or mean?
What do you mean by platform independence?
What is a Presistent Object?
What is pass by value?
What is the syntax and characteristics of a lambda expression?
worst case complexities of Quick sort and Merge sort.
What is a Hash Table? What are the advantages of using a hash table?
what is session in java?
How do you check if an arraylist is not empty?
Why are variables important in research?
What does function identity () do?
What is difference in between java class and bean?
What is concurrent hashmap and its features?