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

When should you use Abstract Class vs Interface while
programming? Give 1 Example

Answer Posted / pravin shrirao

Interfaces are used when we want classes should follow the
rules strictly. Rules like naming coventions e.g. if in
customer class one developer add method AddCustomer other
developer while implementing Invoice class could write
method name InvoiceAdd and also could change the Signiture
rules. for addition of customer we have at client code as
Cutomer.AddCustomer(A,B,C); and Invoice.InvoiceAdd(A,B)
To maintain uniformality if we declare interface and define
method Add(A,B) in that interface and implement that
interface in both the classes then the code will be uniform
all over the classes where ever we have implemented
interface and also all concrete classes must contain
methods which are defined in the interfaces.

Is This Answer Correct ?    22 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

hi, kindly send WWF(.net 3.5) pdf notes to my id. thanx in advance, chays

2294


Explain write back and write through caches? : Dot net architecture

969


Explain the difference between primary & secondary storage device? : .NET Architecture

883


How to implement the display in the class printdoc (how to resolve the naming conflict) a: no naming conflicts

1011


What is an interrupt? : Dot net architecture

903


Explain how cache is used? : Dot net architecture

1023


Explain about generation?

905


8. Oop-Why and were we use Interfacse and Abstract class.

2090


Explain about common language infrastructure?

889


What does this do? Gacutil /l | find /i "corillian"

979


What is an interrupt? : .NET Architecture

836


What is .net mobile utility controls. Explain with an example? : Microsoft dot net mobile

820


What is the purpose of cache? : Dot net architecture

933


any one can explain about projectarchitecture and project approach briefly

2449


HttpHendler and HttpModules

2107