Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


What are the difference between abstract class and interface?

Answers were Sorted based on User's Feedback



What are the difference between abstract class and interface?..

Answer / khalid

A class implementing an interface must implement all of the
methods defined in the interface, while a class extending an
abstract class need not implement any of the methods defined
in the abstract class. Additionally, a class extending an
abstract class can implement an infinite number of it's own
methods.

another key difference between abstract class and interface
is that , in abstract class we can put sharable code, but
that is not possible in case of interface.

Another key difference between abstract class and interface
is that,

We can use interface as marker, ( we can use abstract class
also as abstract but then we can't extends any oter class,
so it is better always use interface as marker)

Marker===> An interface having no methods is called as a
Marker Interface.

Is This Answer Correct ?    24 Yes 6 No

What are the difference between abstract class and interface?..

Answer / manjunath

and in Inheritance all methods should be abstract.means not
defined..but where as in Abstract class methods can be both
Abstract n defined...but one of the method should be Abstract.

Is This Answer Correct ?    12 Yes 4 No

What are the difference between abstract class and interface?..

Answer / muinuddin khan

In abstract class aleast one method must be abstract(only
declared not define).we can create object of abstract class.
if we want to use this class then we have to inherit it.


In interface all the method must be abstract(only define).
using interface we can achieve multiple inheritence.
we use interface where one class cannot extend more than
one class(in java).

Is This Answer Correct ?    15 Yes 12 No

What are the difference between abstract class and interface?..

Answer / amit sharma

A class can extends only one abstract class while a class
can implements any number of interfaces

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More PHP Interview Questions

What is return value in php?

0 Answers  


what is the maximum size of databasi in mysql?

4 Answers  


Is php still relevant 2019?

0 Answers  


Which function would you use to insert a record into a database in php?

0 Answers  


What is the use of $_request variable?

0 Answers  


How can we create a database using php?

0 Answers  


What is the maximum size of a database in mysql?

0 Answers  


Which is variable cost?

0 Answers  


Is ruby on rails php?

0 Answers  


What are sql functions?

0 Answers  


What is the use of final class in php?

0 Answers  


How can you declare the array in php?

0 Answers  


Categories