what is the difference b/w abstract and interface?
Answers were Sorted based on User's Feedback
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 |
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 |
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.
What is destructor give example?
i=20;k=0; for(j=1;k-i;k+=j<10?4:3) { cout<<k; } //please comment on the output
What is difference between class and object with example?
What is constructor in oop?
What is the default size allocated for array in the statement if size not specified " int a[] "
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
Child cObj = new Parent() Wahts the output ?
what is difference between class template and template class?
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!!!)
How is the using() pattern useful? What is IDisposable? How does it support deterministic finalization?
What is multidimensional array?