Difference between abstract class and interface

Answer Posted / sunita

1) abstract classes may contain one or more abstract methods(methods that can't be instantiated). on the other hand interface should contain only abstract methods.

2) abstract classes may implement some of its methods that are not abstract. but interface can't implement any of its method becoz al its methods are abstract.

3)in interfaces all the methods are implicitly abstract,final,static so these modifiers can b omitted but this nit the case wid abstract classes.

4)an important point to note about abstract classes is: they can be subclassed,this sub class implement all the abstract methods that are declared in abstract class.

interfaces provide an alternative to multiple inheritance becoz a class can implement more than one interface.

but an abstract can b sub classed only once.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is sessions and cookies take one example simple way to understand

1859


Is .net easier than java?

528


Why only boxed types can be unboxed?

632


Explain about validation?

609


How cache is used? : Dot net architecture

500






How cache coherency is eliminated? : Dot net architecture

516


What is textview control of .net mobile? : Microsoft dot net mobile

494


Explain .net mobile selectionlist control? : Microsoft dot net mobile

507


What are the types of application software?

509


which is the institute in hyderabad for providing the live project industry training

2340


State and explain about microsoft.net?

532


Explain dma? : Dot net architecture

568


Tell me .net mobile emulators? : Microsoft dot net mobile

559


How do I write to the application configuration file at runtime?

530


IS IT Possible to inherit the AJAX page from child class which(child) is inherit from page class.Because i should apply some security in child class

1548