Difference between abstract class and interface
Answer Posted / s.arun
Main difference is methods of a Java interface are implicitly abstract and cannot have implementations. A Java abstract class can have instance methods that implements a default behavior.
Variables declared in a Java interface is by default final. An abstract class may contain non-final variables.
Members of a Java interface are public by default. A Java abstract class can have the usual flavors of class members like private, protected, etc..
Java interface should be implemented using keyword “implements”; A Java abstract class should be extended using keyword “extends”.
An interface can extend another Java interface only, an abstract class can extend another Java class and implement multiple Java interfaces.
A Java class can implement multiple interfaces but it can extend only one abstract class.
Interface is absolutely abstract and cannot be instantiated; A Java abstract class also cannot be instantiated, but can be invoked if a main() exists.
In comparison with java abstract classes, java interfaces are slow as it requires extra indirection.
For m ore detail click on http://edugoing.com/qna/index.php?qa=1&qa_1=what-the-difference-between-an-interface-and-abstract-class
Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
Explain about clr?
Explain about microsoft visual studio?
What is textview control of .net mobile? : Microsoft dot net mobile
Can you explain control extenders?
4. Wcf- what Asych and Sych call and how that works
How to implement the display in the class printdoc (how to resolve the naming conflict) a: no naming conflicts
What is the use of web.config?
what are the fundamental and common properties of .net controls?
Explain the race around condition? : Dot net architecture
I am working with asp.net 2005 and Crystal report 10. I have an image field on my dataset to show on Crystal report.And the image is shows dynamically from database in image field of CR. The image field is showing well on my Crystal report on its first page with all other data but when i click to open second page of CR,it does not show any data on that.I found that this is because of adding the image field on crystal report. Because when i remove the image field from the CR then it will run both the pages of CR. I am using the Page Load event to bind CR data with Database. And i have already check with the Init event to bind CR , but it still not shows the data on second page when i use image field on that. Please give solution for that.....
What is .net mobile input validation. : Microsoft dot net mobile
Explain different pipelining hazards and how are they eliminated? : .NET Architecture
Explain the purpose of cache? How is it used? : .NET Architecture
deference between display and visibility property of CSS
What is a clickonce application?