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

Explain pipelining? : .NET Architecture

968


4. Wcf- what Asych and Sych call and how that works

1940


how can we achieve language interoperability through CLS? How MSIL works?

1086


what is inheritancy where u required ?

1995


How resource files are used in .net?

1041


Why am I getting an invalidoperationexception when I serialize an arraylist?

900


Xmlserializer is throwing a generic "there was an error reflecting myclass" error. How do I find out what the problem is?

961


Explain about clr?

1061


How do I prevent concurrent access to my data?

1039


question related to table havi colspan and row span

2264


What is a service contract, operation contract and data contract?

944


Why the config file might not be writable

1136


Is dim fs as filestreamobject is a managed code? : Dot net architecture

985


Define a virtual memory? : Dot net architecture

919


So what exactly is the configuration file for then?

966