what is difference between abstract and interface?
can i give real time example for the two topics?

Answer Posted / pawan v. tak

abstract class cantains implemented as well as non
implemented methods.The non implemented methods are called
as abstract methods.if we do not provide the
implementations of all the methods of the abstract class
the class that extends this class should be declared as
abstract.
And interface contains only abstract methods, i.e no method
implementaion is there in interface.In interface all data
members are public final and static means they wont be
changed and can be called by using classname and "."
operator. If you need to change your design, make it an
interface.

Is This Answer Correct ?    17 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What exactly is java?

519


What is an eror in java?

561


What do you mean by jjs in java8?

562


What is the largest long allowed by java?

541


'A class is a template for an object' explain this statement.

550






What is the hashcode () and equals () used for?

539


Can we create our own daemon thread?

544


What is an arraylist in java?

519


How can you generate random numbers in java?

592


What is the SimpleTimeZone class?

1801


Where pragma is used?

604


What do you mean by mnemonics?

537


Is ++ operator is thread safe in java?

519


When super keyword is used?

600


Can an object be null?

553