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
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.....
Does .NET runtime offer Deterministic Destruction or not?
Explain cache? : Dot net architecture
how to change the title of my window?
Tell me .net mobile emulators? : Microsoft dot net mobile
Explain the number or character entered through keyboard gets converted to equivalent ascii code & it get stored on ram in the binary form. What is the exact procedure on hardware that converts the ascii value to binary? : .NET Architecture
define cache memory? : Dot net architecture
Can you explain scriptmanager control?
Explain dotnet framework ?
What is a virtual memory? : .NET Architecture
What are the main Tools to develop .Net Application?
How can we perform data binding in atlas?
Explain some of the disadvantages due to microsoft.net?
what is inheritancy where u required ?
Waht is Dot net Arcitecture