what is the difference b/w abstract and interface?

Answers were Sorted based on User's Feedback



what is the difference b/w abstract and interface?..

Answer / n.suresh

Abstract can,t support multiple inheritence.
Interface can suppport the multiple inheritence.

Abstract have accesbulity modifiers.
Interface have no accesbulity modifiers.

Is This Answer Correct ?    11 Yes 0 No

what is the difference b/w abstract and interface?..

Answer / bhaskar.mantrala

Interfaces are same as classes but their methods are
declared with out any body..... and definition
corresponding to that allmethods will write on
implementation class(i.e)single class.BUT
Eg:
interface interfacename
{
//Declarations only
//first method
//second method
..
..
//n-th method
//final variables
}
class classname implements interfacename
{
//Definitions of ALL methods present in interfacename
}
Abstract class also has same as interface and definitions of
all those methods may not be present in single extended class.

And we doesn't create an object to class that is abstract.

Is This Answer Correct ?    3 Yes 1 No

Post New Answer

More OOPS Interview Questions

i had specified the access specifier for abstarct class member like (pure virtual function) as private.But it can be accessed by the derived class.How the private member of one class is accessed by other class.if any body face this problem and found the solution plz reply to me.

1 Answers   Syntel,


What is destructor give example?

0 Answers  


i=20;k=0; for(j=1;k-i;k+=j<10?4:3) { cout<<k; } //please comment on the output

0 Answers  


What is difference between class and object with example?

0 Answers  


What is constructor in oop?

0 Answers  






What is the default size allocated for array in the statement if size not specified " int a[] "

4 Answers   CTS,


1. Strong name 2. how to prevent a class from being inherited 3. delegates 4. default modifier for interface 5. default modifier for class 6. base class for exception 7. diff bet trigger and view in sql 8. how to exchange values from one page to another page 9. can multiple catch block ll be executed at same time 10. can u store different data types in an array & array list 11. when we ll use trigger 12. try,catch,finally usage

2 Answers  


Child cObj = new Parent() Wahts the output ?

8 Answers   Patni, TCS,


what is difference between class template and template class?

0 Answers  


Write a C++ program without using any loop (if, for, while etc) to print prime numbers from 1 to 100 and 100 to 1 (Do not use 200 print statements!!!)

0 Answers   HCL,


How is the using() pattern useful? What is IDisposable? How does it support deterministic finalization?

1 Answers   IntraLogic,


What is multidimensional array?

1 Answers  


Categories