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
What is destructor give example?
Is react oop?
write a code for this. serial_number contained in the header of the file will be read , if this serial number is less than a previous serial number within a successfully processed file, or is the same as another serial number within a successfully processed file, or if the field contains anything other than 7 digits, then the file must error with the reason ‘Invalid SERIAL_NUMBER’.
What is the real time example of inheritance?
What is coupling in oop?
can inline function declare in private part of class?
What is polymorphism used for?
write a code for this:trailer recordId contains a value other than 99, then the file must error with the reason ‘Invalid RECORD_ID’(User Defined Exception).
What are the data types in oop?
What does and I oop mean in text?
How long to learn object oriented programming?
Where You Can Use Interface in your Project
just right the logic of it 1--> If few people are electing then every time ur candidate should win 2--> arrange books in box, if box carry weight == books weight then take another box..... find the no of box required.
What is the benefit of oop?
What is the use of oops?