What is differance between Abstract and Interface

Answer Posted / poorna chandar rao

diffrence bettwen the abstract class and interfaces

abstract class is having abstarct methods and concrete
methods abstarct class as compulosry having subclass for the
implementation abstarct methods and abstarct does not
support multiple inheritence
because one subclass extend the abstract class their is no
scope for extends for another class because it is not
support for the multiple inheritence
ex 1: abstract class one
2 class two extends one extend three (not valid)

but interface having only method signature in the interface
their is concrete method and it supports the multiple
inhirtence because

ex: interface one
class two implements one extends three(valid)
onc class implemens the interface and extends to another
class that is support the multiple inhertince

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the renewal class?

2431


Which is not an object oriented programming language?

754


What is encapsulation process?

798


Why is destructor used?

773


What is destructor in oop?

806


What are the 3 pillars of oop?

884


write a program using c++ to implement single contiguous memory mangement techniques.display the content of the main memory after yhe allocation of jobs and percentage of the wastage of the main memory

2997


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’.

2002


Question In a class, there is a reference or pointer of an object of another class embedded, and the memory is either allocated or assigned to the new object created for this class. In the constructor, parameters are passed to initialize the data members and the embedded object reference to get inialized. What measures or design change should be advised for proper destruction and avioding memory leaks, getting pointers dangling for the embedded object memory allocation? Please suggest. Question Submitted By :: Sunil Kumar I also faced this Question!! Rank Answer Posted By Re: In a class, there is a reference or pointer of an object of another class embedded, and the memory is either allocated or assigned to the new object created for this class. In the constructor, parameters are passed to initialize the data members and the embedded object reference to get inialized. What measures or design change should be advised for proper destruction and avioding memory leaks, getting pointers dangling for the embedded object memory allocation? Please suggest. Answer # 1 use copy constructors 0 Shanthila There is something to be taken care in destructor, in copy constructor, suppose the memory is assigned to the embedded member object pointer with the parameter passed value, but if some other objects of different class also are pointing to this memory, then if some one deletes the object then this class member pointer object will become dangling, or if the object is not deleted properly then there will be memory leak. Please suggest the design change required to handle or avoid this situation

1920


What are the three main types of variables?

842


What is destructor oops?

858


if i have same function with same number of argument but defined in different files. Now i am adding these two files in a third file and calling this function . which will get called and wht decide the precedence?

3132


What is encapsulation with example?

808


What is object-oriented programming? Webopedia definition

967


What is encapsulation in ict?

823