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
What is hash table in java?
Does java return by reference?
How do you make an arraylist empty in java?
What are the types of java languages?
worst case complexities of Quick sort and Merge sort.
how are methods defined?
Which is better singleton or static class?
What is bubble sort in java?
What do you mean by Function Overloading in java?
Define max and min heap, also the search time of heap.
Explain a few methods of overloading best practices in java?
What is the difference between a vector & an array list?
What is nested top-level class?
What does n mean in java?
Is 64bit faster than 32 bit?