0
Why do i get an error initializing an IContainer. IContainer cont = new IContainer();
9 odpowiedzi
+ 6
I don't know what's with all the down votes, but like @Mr Programmer mentioned, IContainer is an interface. .NET uses the "I" prefix convention to indicate this.
The reason you can't instantiate an interface is because it doesn't have an implementation. Classes derived from from the interface provide the implementation, which is the purpose of interfaces-- It provides a common means of interaction amongst various container classes.
+ 4
@Squidy you are right someone hates me.
+ 3
interface can be initialized like this.
example
interface test{
//...... code
}
class a:test{
///.... code
}
test cont = new a();
you cannot write this
test cont = new test();
+ 3
its similar to inheritance
+ 2
Icontainer is an interface .
https://msdn.microsoft.com/en-us/library/system.componentmodel.icontainer(v=vs.110).aspx
+ 2
btw it wasnt me my phone doesnt even allow me to give thumbs up or down and says no connection when i press them.
+ 1
Yup but I dont know how use it not how to create it if you dont mind helping me i would really appreciate it.
+ 1
is a the inheritence
+ 1
okay i sees now