What is the difference between and interface and an
abstract class ?
Answer Posted / porchelvi
ABTRACT CLASS
*************
• It can not be instantiated
• It allow us to specify all access modifier except
Private
• A class inheriting this must implement all of its
abstract method
• A class can inherit only one abstract class at a
time.
• Abstract class can add more functionality with out
destroying child classes that were using old version.
• We can declare the following
1. Fields
2. Constructors
3. Static Constructors
4. Static Functions
5. Concrete Functions
INTERFACE
*********
• It can not be instantiated
• It allows only public Access modifier
• A class implementing interface must provide body
for its entire member.
• A class can implement more than one interface at a
time.
• Adding of additional functionality will have an
effect on its child class due to the necessary
implementation of interface methods.
• We can not declare the following
1. Fields
2. Constructors
3. Static Constructors
4. Static Functions
5. Concrete Functions
| Is This Answer Correct ? | 11 Yes | 2 No |
Post New Answer View All Answers
Why do pointers exist?
Why it is called runtime polymorphism?
design a c++ class for the chess board,provide a c++ class definition for such class(only class definition is required)
What is pure oop?
What is oops concept with example?
what is the drawback of classical methods in oops?
What is abstraction in oop with example?
Which is not an object oriented programming language?
What is oops in simple words?
Question: Write a program that prints a paycheck. Ask the program user for the name of the employee, the hourly rate, and the number of hours worked. If the number of hours exceeds 40, the employee is paid “time and a half”, that is, 150 percent of the hourly rate on the hours exceeding 40. Be sure to use stepwi se refine ment and break your solution into several functions. Use the int_name function to print the dollar amount of the check.
What is the purpose of polymorphism?
explain sub-type and sub class? atleast u have differ it into 4 points?
Why multiple inheritance is not allowed?
What is object and example?
What is meant by multiple inheritance?