what is the difference between abstract class and
Interface?where we can use it in realtime projects?

Answer Posted / neha thakur

abstract class contains all abstract method or all concrete
method or combination of both. we can not directly create
object of abstract class.abstract class methods must
implemented in sub class.

interface contains declared method but does not contain body
of method.like abstract class we can not create instance of
interface.methods defined in interface are public &
implicity called as abstract method & interface must be
implemented in the classes with implements keyword which
contains implementation of methods

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is nextline method in java?

782


What is lastindexof in java?

749


Can a static class implement an interface?

791


Define reflection.

734


Can a boolean be null java?

732


Why do people says “java is robust”?

757


Give me an example of array and linked list? Where they can be used?

756


What is the requirement of thread in java?

814


What is a memory leak in java?

765


What is the difference between checked exception and unchecked exception?

763


What is boolean in java?

694


What is nested loop? What is dangling else condition in it?

801


how does the run() method in runnable work? : Java thread

684


Is array passed by reference in java?

782


If A Class Is Declared Without Any Access Modifiers, Where May The Class Be Accessed?

911