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
Why we use methods in java?
What are the differences between path and classpath variables?
What is null statement?
In a program, initializing an array of 100 KB is throwing an out of memory exception while there is 100 MB of memory available. Why?
What is high level language in computer?
What happens if a constructor is declared private?
What one should take care of, while serializing the object?
How do you use equal in java?
Can we convert stringbuilder to string in java?
How do you represent a space in regex java?
What is meant by collection in java?
What is string substring?
What is static and final keyword in java?
In which order the iterator iterates over collection?
What is the meaning of course?