Sumit
Said..
A C# Class Considered being the primary building block of the language. What I mean by the primary building block of the language is that every time you work with C# you will create Classes to form a program. We use Classes as a template to put the properties and functionalities or behaviors in one building block for some group of objects and after that we use that template to create the objects we need.
A class can contain declarations of the following members:
Constructors, Destructors, Constants, Fields, Methods, Properties,Indexers, Operators, Events, Delegates, Classes, Interfaces, Structs
An interface contains only the signatures of methods, delegates or events. The implementation of the methods is done in the class that implements the interface. A class that implements an interface can explicitly implement members of that interface. An explicitly implemented member cannot be accessed through a class instance, but only through an instance of the interface.
An interface can inherit from one or more base interfaces. When a base type list contains a base class and interfaces, the base class must come first in the list.
interface ISampleInterface { void SampleMethod(); }
class ImplementationClass : ISampleInterface { // Explicit interface member implementation: void ISampleInterface.SampleMethod() { // Method implementation. }
static void Main() { // Declare an interface instance. ISampleInterface obj = new ImplementationClass();
// Call the member. obj.SampleMethod(); } }
|
Suruchi Kapoor
Said..
Can U cite a simple example for it?
|
Mehul
Said..
we can also use like this......
ImplementationClass obj = new ImplementationClass (); // Call the member. ((ISampleInterface)obj).SampleMethod();
|
|
|
Faez
Said..
If you can provide Examples, with real time examples. Its is much more easer to understand... Thank you!!!!
|
Zeel
Said..
if u want to understand abt it thn its really usefull n also 4 understand d example thnx a lot....!!!!
|
Mayur
Said..
what is main benefit of the interface???
|
SAJ
Said..
the main benefit of the INTERFACE is enabling multiple INHERITANCE IN c Sharp and mostly used in EVENT DRIVEN PROGRAMMING
|
these all the answers are theoretical Can u tell me difference between IDatareader and Datareader
|
|
|
Rajesh
Said..
C# does not support the Multiple Inheritance(Using in C++).To Implement the multiple inheritance concept in C# and Java we use the interface.Interface always declared with public Keyword. we can not create the object of interface but we can create the virtual object of interface. In interface we can only declare the method/function but not define here.we must define it in that class who inherit the interface. for examples
public interface A { void show(); } public interface B { void disp(); } class C:A,B { public void show() { } public void disp() { } } class test { public static void Main() { C c1=new C(); c1.show(); c2.disp(); A a1=c1;//Virtual Object Console.ReadLine(); } }
|
formulaone87 Said..
Hi rajesh...r other frndz:-)
kindly let me knw the use of creating virtual objects for interface??? will be needy...
anyone else are welcome too... plz..
|
samm
Said..
so objects of interface can be made in c# unlike in java?? I thought in java, interface objects cannot be made because they dont have a constructor. That virtual object thing is what i dont get.
|
aaa
Said..
An interface contains only the signatures of methods, delegates or events. The implementation of the methods is done in the class that implements the interface. A class that implements an interface can explicitly implement members of that interface. An explicitly implemented member cannot be accessed through a class instance, but only through an instance of the interface.
An interface can inherit from one or more base interfaces. When a base type list contains a base class and interfaces, the base class must come first in the list.
|
|
|
tang
Said..
These kits are not all of precisely the same exact so make particular Cheap Pandora that the diamond jewelry will possible be risk-free inside the package deal you purchase. Some kits arrive with anything you should clean up your jewelry. Some phone Cheap Pandora Charms call to suit your needs do in the direction of the cleaning, regardless of the actuality that other individuals are merely a alternative you leave your ring Cheap Pandora Bracelets Sale in.If you would instead not try cleanup your diamond jewelry your do it yourself there really are a few other possibilities you have on the marketplace to Hot Pandora Bracelets Sale you. You can now purchase diamond jewelry cleaners that use increased volume to clean up your jewelry. All you do is suit your diamond jewelry inside the Cheap Womens Pandora Necklaces cleaner and turn it on also it does the run for you. the instant once more you will should review the directions to create particular how the Cheap Pandora Charms on sale diamond jewelry you need to clean up will possible be risk-free inside the machine.
|
tang
Said..
It is essential that you simply rinse your diamond jewelry if you are pandora jewelry cheap sale carried out cleanup it to create particular you have the excessive create up and cleanup soap off. most ideal after rinsing you will need to take cheap authentic pandora jewelry advantage of a lint completely free towel if feasible to pat the diamond jewelry dry.If you take advantage of the approach to cleanup and therefore are cheap pandora leather bracelets not happy using the effects you can possibly need to try producing utilization of the mixture of half consuming water half ammonia. You can soak your cheap pandora rings ring for half an hour on this solution. most ideal after your diamond jewelry is carried out soaking you will need to take advantage of a cheap pandora beads small, gentle brush to clean up it. subsequent you will rinse the diamond jewelry inside the alternative again, after which rinse below cozy consuming water before pandora necklaces for sale to towel drying. You can locate diamond jewelry cleanup kits on the store that are ready to go.
|
tang
Said..
Many of us have diamonds or other diamond jewelry that could possibly should be pandora beads discontinued cleaned. Our day time to day time actions induce these pieces to turn out to be dirty and in phone call for of some care. Lotion, soap, and skin pandora jewelry outlet stores color essential oil can induce a film to appear in your jewelry. Even in situation you don't suit in your diamond jewelry daily it may collect dirt in storage. Cheap Pandora Jewelry right listed here are many troubles you can perform to retain your diamond jewelry looking its best. among the troubles you can perform in your house is rinse your Pandora Beads diamond jewelry within of a bowl of soapy water. make particular you take advantage of a mild cleanup soap concerning not harm your jewelry. You will need to take pandora charms cheap sale advantage of a soft, tiny brush using the mixture to acquire every one of the create up off. The gentle bristles will possible be gentle enough for the diamonds, pandora charms on sale usa but will nevertheless obtain the create up loose to ensure that you simply can rinse it off.
|