difference between abstract class and interface in java
Answers
Answered by
1
ABSTRACT CLASS:
1- THE ABSTRACT KEYWORD IS USED TO PRESENT ABSTRACT CLASS.
2- IT CAN HAVE FINAL, NON-FINAL,STATIC AND NON-STATIC VARIABLES.
3-IT CAN PROVIDE IMPLEMENTATION OF INTERFACE AND IT CAN HAVE ABSTRACT AND NON-ABSTRACT METHODS.
INTERFACE :
1- THE INTERFAE KEYWORD IS USED TO PRESENT INTERFACE.
2- IT HAS ONLY STATIC AND FINAL VARIABLES.
3- IT CAN NOT PROVIDE IMPLEMENTATION OF ABSTRACT CLASS AND IT HAS ONLY ABSTRACT METHODS.
1- THE ABSTRACT KEYWORD IS USED TO PRESENT ABSTRACT CLASS.
2- IT CAN HAVE FINAL, NON-FINAL,STATIC AND NON-STATIC VARIABLES.
3-IT CAN PROVIDE IMPLEMENTATION OF INTERFACE AND IT CAN HAVE ABSTRACT AND NON-ABSTRACT METHODS.
INTERFACE :
1- THE INTERFAE KEYWORD IS USED TO PRESENT INTERFACE.
2- IT HAS ONLY STATIC AND FINAL VARIABLES.
3- IT CAN NOT PROVIDE IMPLEMENTATION OF ABSTRACT CLASS AND IT HAS ONLY ABSTRACT METHODS.
Similar questions
Science,
8 months ago
English,
8 months ago
Environmental Sciences,
8 months ago
Social Sciences,
1 year ago