Can you explain the difference b/n abtract and interface
with a good example,?In what cases we have use abtract and
what case interface?

Answer Posted / nt.jayan

Interface contains final variable and method signatures
only. All of this method and variable are should be public.
In Technically interface like Pure Abstract class.

Abstract class contains both abstract method also may having
some method defination. When we want to use some of the
functionality in abstract we use Abstract class.

Also, By using Interface we achieve multiple inheritence
using Implements. When we use Abstract class we can extends
only.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the 3 types of loops in java?

712


Which programming language is best in future?

708


if u open login & logout ,how can udisplay the timelogin & logout members ?

1932


How do you write a conditional statement?

696


Why wait(),notify(),notifyAll() methods defined in Object class althought we are using in only threads.

2557


What are peerless components in java programming?

756


What are the important features of Java 11 release?

770


When throw keyword is used?

787


Justify your answer that you can't define a method inside another method in java, if you can then how?

793


How are multiple inheritances done in Java?

829


how to convert Java project into Maven ?

784


What is pangram in java?

748


what happens when a thread cannot acquire a lock on an object? : Java thread

784


How many types of java are there?

741


What is a buffer in computer?

697