In C#, you can call a method on an instance of a class using the dot notation. Here's an example:
main.cs272 chars15 lines
In the example above, we define a simple class MyClass
with a method MyMethod
that writes "Hello world!" to the console. We then create an instance of the class myObj
using the new
keyword, and call the method MyMethod
on the instance using dot notation (myObj.MyMethod()
). This will write "Hello world!" to the console.
gistlibby LogSnag