About a class inherits class and implements interface

J

Jet Leung

Hi all,
In VB.net if I want to inherits a Class and implement a interface I can
wrote like this:

Class A
Inherits CObject
Implements IObject
.....
End Class

And if I want to do the same things like the VB code in C# ,how to do that??
like this?
Class A:Object,IObject ???
 
J

Jon Skeet [C# MVP]

Jet Leung said:
Hi all,
In VB.net if I want to inherits a Class and implement a interface I can
wrote like this:

Class A
Inherits CObject
Implements IObject
....
End Class

And if I want to do the same things like the VB code in C# ,how to do that??
like this?
Class A:Object,IObject ???

Yes, exactly.
 
S

Stoitcho Goutsev \(100\) [C# MVP]

Hi Jet
In VB.net if I want to inherits a Class and implement a interface I can
wrote like this:

Class A
Inherits CObject
Implements IObject
....
End Class

And if I want to do the same things like the VB code in C# ,how to do that??
like this?
Class A:Object,IObject ???

Correct. Don't forget, thought, that unlike VB C# is case-sensitive language
and the keywords are written with small letter anly. In particular *class*
is with small 'c'.

class A:Object,IObject
{
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top